If you tried separating the tokens using a space as the delimiter, an issue that I see is that the path\executable name can itself contain a space. This is usually resolved by surrounding that token with quotes. So as you are parsing the whole string, you'd need to keep track of whether you were in a quote or not. If so, then spaces do not count.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
Supposed I have a text file having the results of the 6/49 lottery in it:
How can I achieve the following output written to a text file with filename, "occurences.txt"?
49 - 2 times
49 paired with 13 - 2 times
I don't have an exact idea but maybe the following pseudocode can help:
void main ()
cout<<"CHARACTER \t\ How many times it appeared"<<endl;
for (number='01'; number<='49'; number++)
cout<<number<<" - \t"<<countNumber(numbercount)<<" times"<<endl;
cout<<number<<" paired with \t"<<number<<" "<<ountNumber(numbercount)<<" times"<<endl;
int countNumbers (int number)
ifstrem.stream; //to open the fileint numbercount;
int count=0; //counter to count occurences
stream.open ("countNumbers.txt"); //this opens the file
How can I go about this?
Last Visit: 26-Oct-20 0:57 Last Update: 26-Oct-20 0:57