but, how do I code it so it will work for every word in the file that I need it to. because i am clueless
Type: Posts; User: luckyboy23
but, how do I code it so it will work for every word in the file that I need it to. because i am clueless
.
.
if (iLeng>7)
{
for(int i=0; i<=2; i++)
{
ifIn>>temp[i];
}
strcat(temp,"er");
ifIn.getline(szTemp,20,' ');
iLeng=strlen(szTemp);
if(iLeng==7)
{
//do something
}
I have to read in from input file and if a word in that file is longer than 7 letters insert "er" after the 3 letter of that word. I started by reading the file into a cstring. I know how to find...
I not sure but this may work.
strcpy(char,"substring");
if i understand the question correctly
i figured out the getline thanks for the help.
but now i have to read in a word and insert the word "uh" after the 4th letter in that word.
for example:
read in "programmer" and change it to...
I am trying to read in from an input file and everytime the word "is" appears in the file, replace it with "are".
will this work?
string word;
for (int i=0, i<kiSize, i++)
{
I haven't started the program yet I am trying to decide what all i need to do before I begin.
When i read in from an input file how do i know if a word in that file ends with an s.
And what if I have to change the word shoe to sock everytime the word shoe is in the file. How would i do...
thanks I'm good now
when i pass istream to a class function how do i use the istream that is sent?
This is what i am trying but i don't know how to use the in
void class::readinBalance (istream & in)
{
...
I have to write a input function for a class. The function is suppose to readin the initial balance of a bank account and the interest rate, but i have to have a perameter of type istream. My...
input into a string array
what is wrong with this: (when i run my program it gets to the while loop and stops, it stays in the program but doesn't do anything)
[code]
while (!ifIn.eof()); // I think the problem is...
when i have getline(ifIn, strFile); in my program does it require imput from the user.
if in is my ifstream
strFile is my string i am reading the file into
nevermind its too much trouble, thanks for the effort, i'll figure it out
don't know how to post my code
I have an input file called jfk.dat and heres what i have to do:
I am having trouble reading it into a string.
that aint all but that will do for now
I have to write a program that reads in data from a text file and
tells how many of each punctuation mark is in the file and then tells the average length of each word in the file. so my question...