Thank you, Banfa
P....
User Profile
Collapse
-
Output of debugging session:
------------------------------------------
Breakpoint 1, main () at linked_list_net .cc:51
51 while(topNode)
(gdb) n
53 (*(topNode->funcPtr)) ();
(gdb) n
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb)Leave a comment:
-
segFault in linked-list
Hi,
Could anyone please show me why the following segfault occurs
at line 54 in the following code?
...Code:1 #include <stdio.h> 2 #include <stdlib.h> 3 4 void printHello() 5 { printf("Hello "); } 6 7 void printThere() 8 { printf("There\n"); } 9 10 void (*FuncPtrArry[2])() -
-
How do I resolve this in C? Could I type-cast the p1 (at line 21) to (mystruct *).
I tried, but it didn't work either.
P.Leave a comment:
-
Compile errors on casting
Hi,
I had a bit of compile problems in casting a pointer.
Could anyone point out my misunderstandin g of the concept here?
...Code:1 #include <stdio.h> 2 #include <stdlib.h> 3 4 typedef struct 5 { 6 char charArray[64]; 7 } mystruct; 8 9 int main(int argc, char* argv[]) 10 { -
Hi, Banfa:
Thanks for the response.
Wonder if there is a way to resolve this circular dependency problem with simply one file (ie, no header and implementation files separately), with all the methods being in-lined in header file?
Thx,
TRLeave a comment:
-
Circular inclusion problem (forward declare)
Hi,
I got the following circular inclusion problem, and hope that
someone could show me some help here.
Code:
=============== ===
...Code:1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 // class Welcome; 6 class Mediator; 7 8 class Welcome 9 { 10 -
Thanks weaknessforcats , it worked after I forward-declared the waitingState class, and moved the codes around. PLLeave a comment:
-
Johny10151981:
I defined waitingState as an object pointer in line 34. Are u suggesting
that waitingState as an pointer is causing the problem here?
thanks,
PLLeave a comment:
-
Failed to compile in C++
Hi,
I got the following snippet of codes which gave me the following
compile errors. I would really appreciate if anyone could tell
me what I have done wrong.
...Code:1 #include <iostream> 2 #include <string> 3 4 class State; 5 class StateMachineInterface 6 { 7 public: 8 virtual void gotApplication() -
Thanks, Banfa. I updated my compiler to a newer version, and it's compiling fine now.
Regards,Leave a comment:
-
I tried your suggestions, but still failed:
============
...Code:#include <iostream> #include <list> using namespace std; int main() { std::list<int> myList; std::list<int>::iterator it; myList.push_back(0); it = myList.begin(); myList.insert(it, 2); // 2 0 myList.insert(it,2,20); // <--- CompileLeave a comment:
-
list::insert(iterator position, size_type n, const & x); failed to compile
Hi,
I got the following compile errors when I used STL
list::insert ( iterator position, size_type n, const T& x );
=============== ===
...Code:#include <iostream> #include <list> main() { list<int> myList; list<int>::iterator it; myList.push_back(0); it = myList.begin(); myList.insert(it,
No activity results to display
Show More
Leave a comment: