I want to say
for(i = 0; txt != ' '; i++)
where txt is a char variable and i is an int variable.
Is this legal or is there a more specific way to refer to a blank space?
Well, I was trying to include that line of code in a program. But I fear that I'm stuck in an infinite loop somehow. I've isolated the problem to be in my read function.
void read(char txtstr[], int& size)
{
int n, i, x;
char txt, tempstr[MAX];
It is difficult to understand what exactly you are trying to accomplish with your read function. Are you trying to get a string, excluding spaces and full-stop, and terminating on the full-stop?
(eg
"Hello world."
becomes
"Helloworld" )?
Well, my program is supposed read a sentence in which the spacing and/or capitalizations are assumed to be off. For example, " i AM the World." and it is assumed to end with a period. So what I'm trying to do with my read function is to read every group of words as a temporary string including the space (which signifies the end of the word) so that I can then store it in a larger string in which the spacing will be corrected.
Moreover, I just realized that I don't read the next character after executing the loop once. I have modified this, but that still doesn't solve the problem.