Hi everyone, this is my first post so be nice!!

I want to read from a text file and output single characters to an external device. I can access the file, read the whole string, and output the whole string to the device. But I really need to do it character at a time in a wee loop.

Here's the code I have so far;
---------------------------------------------------------------------------------
Code:
	if((textfile = fopen("temp.txt","r"))==NULL){
		printf("Error opening text file for reading\n");
		exit(0);
	}

	while((fscanf(textfile, "%s", line)!=EOF))
                {
		
		WriteFile(hCom, line, 1, &temp, NULL);
	}

	fclose(textfile);
---------------------------------------------------------------------------------

What it is doing is opening the file for reading and if it can't it'll output an error message. The it scans the file and outputs through the COM port.

The problem I am having is that I can't split the string up into individual characters. When I output the whole string to the device it, obviously, only receives the first character since I'm only sending a byte at a time.

Any help in splitting the string up would be greatly appreciated.

Thanks