Category : declaration

I am learning C++. In particular, the difference between declaration and definition. To my current understanding All definitions are declarations but not all declarations are definitions. Here is an example of what I currently know. int x; //definition(as well as declaration according to the above quote) extern int y; //declaration that is not a definition ..

Read more

I HAVE MADE A PROGRAM TO PRACTICE FRIEND FUNCTION USING TWO DIFFERENT WAYS BUT ONE OF THEM IS GIVING ERROR WHILE THE OTHER ONE NOT PLS HELP TO KNOW WHAT IS THE PROBLEM.PLS, THE ANSWER SHOULD BE BEGINNER-FRIENDLY. #include<iostream> using namespace std; class myclass1; class myclass2; class myclass1{ int a,b; friend int myclass2 :: sum(myclass1); ..

Read more

I encountered the error : error: ‘data_structure’ was not declared in this scope, when compile following codes. I assume errors happened in : root = data_structure.insert(root, data[data_ind]); data_structure.insert(data[data_ind]); TreapNode<int> *res = data_structure.search(root, search_data[s_data_ind]); bool res = data_structure.search(search_data[s_data_ind]); But I don’t know what I should correct. complete codes : https://gist.github.com/theabc50111/05651b8c125feaaff5f80f15deb535f4 partial codes: void test(string file_name_it, string ..

Read more

Instead of using typedef typename for the iterator is it possible to use using keyword? using schedulable_ops_t = std::list<mlir::Operation*>; typedef typename schedulable_ops_t::iterator schedulable_ops_iterator_t; I tried using schedulable_ops_t::iterator = schedulable_ops_iterator_t; but I get an error is not a base type for type. Source: Windows Que..

Read more