Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What gives?

Name: Anonymous 2010-01-17 10:09

I have a text file called bigint that reads:

3
1 8888888888 2222222222
2 9999999999 10000000000
2 10000000000 9999999999


Yet everytime I run the following code:


#include <stdio.h>
#include <string.h>

int main(){
   
    FILE *ifp;
    char* LOLSTRING;
    int lawl, lawl2;
   
    ifp = fopen("bigint.txt", "r");
   
    fscanf(ifp, "%d", &lawl);
    fscanf(ifp, "%d", &lawl2);
    fscanf(ifp, "%s", LOLSTRING);
   
    printf("%s\n", LOLSTRING);
   
    fclose(ifp);

    system("pause");

    return 0;
}


... the program crashes AFTER the pause is run. Meaning, whenever I press any key, it somehow shits itself. What gives?

Name: Anonymous 2010-01-18 0:33

pausing

You wouldn't have this problem if you compiled and executed your programs from a command line. Why don't you take your kiddie IDE toys out of /prog/ and leave the adults to their work?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List