Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1


    Newbie to c++, just wondering if anyone can help explain why I get a segfault when running this with 'bame' = /home/username/


    #include <stdlib.h>
    #include <iostream.h>

    int main()
    const char *name = "BIGTEST";
    char *bame;
    cin >> bame;
    system("find $BIGTEST");

  2. #2
    Aww shucks. I figured it out. Just erase the first line and replace "name" with "BIGTEST"...

    Why is it that it always takes a forum submission before you can solve your own damn problem. :|

    Corrected code below:

    char *bame;
    cin >> bame;
    system("find $BIGTEST");

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts