Search:

Type: Posts; User: livestrng

Search: Search took 0.00 seconds.

  1. Replies
    10
    Views
    3,059

    Ok, I understand about \n. So should my code...

    Ok, I understand about \n. So should my code read:


    int num, i = 0, read = 0, stop = 1;
    FILE* fp;
    fp = fopen(file, "r");

    do{
    fscanf(fp, "%d", &num);
  2. Replies
    10
    Views
    3,059

    It compiles, but when run: ./num5 num5.txt It...

    It compiles, but when run:
    ./num5 num5.txt
    It yields a Segmentation Fault.

    And what do you mean by check fscanf? Should it not just read in the first line?
  3. Replies
    10
    Views
    3,059

    Integers into array.

    Hello, I'm trying to move the integers in a file to an array and order them. I'm almost positive that I can order them using a sorting method. However, I'm having trouble getting the integers from...
Results 1 to 3 of 3