R
ricky
Can anybody help with the function to get rid of extra characters in
the file.
I want to remove the string from the file.So i read from input file and
pass the string say "john" if found dnt write it to the ouput file but
if not found write all the line to the output file
so i read line by line
cin.get(input,line)
if(line != s)
output<<line
The problem is the input file look like
murphy
john
bridget
sarah
but if i read character by character the file would look like
m
u
r
p
h
y
j
o
h
n
s
a
r
a
h
So if pass string john and compare it line by line it won't match cause
there r two extra character in the end as u can see while reading
character by character
Can any please help to get rid of these extra characters before i do
the comparison
the file.
I want to remove the string from the file.So i read from input file and
pass the string say "john" if found dnt write it to the ouput file but
if not found write all the line to the output file
so i read line by line
cin.get(input,line)
if(line != s)
output<<line
The problem is the input file look like
murphy
john
bridget
sarah
but if i read character by character the file would look like
m
u
r
p
h
y
j
o
h
n
s
a
r
a
h
So if pass string john and compare it line by line it won't match cause
there r two extra character in the end as u can see while reading
character by character
Can any please help to get rid of these extra characters before i do
the comparison