User Profile

Collapse

Profile Sidebar

Collapse
philuu12
philuu12
Last Activity: Apr 7 '14, 12:46 PM
Joined: Oct 14 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • philuu12
    replied to segFault in linked-list
    in C
    Thank you, Banfa

    P....
    See more | Go to post

    Leave a comment:


  • philuu12
    replied to segFault in linked-list
    in C
    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)
    See more | Go to post

    Leave a comment:


  • philuu12
    started a topic segFault in linked-list
    in C

    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])()
    ...
    See more | Go to post

  • philuu12
    replied to Compile errors on casting
    in C
    Thanks for the explanation, weaknessforcats .
    Regards,

    PL
    See more | Go to post

    Leave a comment:


  • philuu12
    replied to Compile errors on casting
    in C
    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.
    See more | Go to post

    Leave a comment:


  • philuu12
    started a topic Compile errors on casting
    in C

    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  {
    ...
    See more | Go to post

  • philuu12
    replied to Circular inclusion problem (forward declare)
    in C
    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,

    TR
    See more | Go to post

    Leave a comment:


  • philuu12
    started a topic Circular inclusion problem (forward declare)
    in C

    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
    ...
    See more | Go to post

  • philuu12
    replied to Failed to compile in C++
    in C
    Thanks weaknessforcats , it worked after I forward-declared the waitingState class, and moved the codes around. PL
    See more | Go to post

    Leave a comment:


  • philuu12
    replied to Failed to compile in C++
    in C
    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,

    PL
    See more | Go to post

    Leave a comment:


  • philuu12
    started a topic Failed to compile in C++
    in C

    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()
    ...
    See more | Go to post

  • Thanks, Banfa. I updated my compiler to a newer version, and it's compiling fine now.

    Regards,
    See more | Go to post

    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);  // <--- Compile
    ...
    See more | Go to post

    Leave 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,
    ...
    See more | Go to post
No activity results to display
Show More
Working...