Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
618 B
3
Indexable
Never
#include<stdio.h>
#include<stdlib.h>
#include<string.h>



void Reading()
{

    int num;

    FILE *myFile;
    myFile = fopen("C:\\Users\\User\\Pictures\\array.txt","r");

    int numberArray[6];
    int i;

    if (myFile == NULL){
        printf("Error Reading File\n");
        exit (0);
    }

    for (i = 0; i < 6; i++){
        fscanf(myFile, "%d,", &numberArray[i] );
    }

    for (i = 1; i < 6; i++){
        printf("%d ", numberArray[i]);
    }

    fclose(myFile);

}

int main(int argc,char** argv)
{
    printf("%s\n",argv[0]);
    Reading();
    return 0;
}