I'm trying to read a column of random sized order numbers from a file and put them in one long string that will be used later. each order needs to be separated by a ",".
Ex:
000111222-1112233
002233-393900
Output:
Value=000111222-1112233,002233-393900
This is what i have so far, but it definitely is messed up... any help is greatly appreciated!
Code:int i; long file; char longOrderID[300]; /* Create a new file */ if ((file = fopen(filename, "r" )) == NULL) { lr_output_message("Unable to create %s", filename); return -1; } strcpy(longOrderID, "Value="); for(i=0;i<=2;i++){ fscanf(file, "%s", longOrderID); strcat(longOrderID, file); strcat(longOrderID, ","); mktemp(longOrderID); i++; }



LinkBack URL
About LinkBacks



