On Jul 3, 7:42 am, Grzesiek <grzesiek.wilanow...@gmail.comwrote:
Suppose i cant modify Hello.cpp file, that means i cant remove stray
x.
Then i want to include Hello.cpp file into any other file, lets call
it Test.cpp. What code should i add to Test.cpp to make the compiler
to ignore stray x in Hello.cpp file?
Let me see if I've got this right. You have files which don't
contain legal C++, you want to include them in a C++ program,
and you want the compiler to ignore the errors. That doesn't
sound reasonable to me.
This is a problem i came across trying to use Genetic Algorithms
Libraryhttp://lancet.mit.edu/ga/
in my Dev C++ project
In GA library evry file has a char ' '(instead of x in the sample
program above) at the end of it and that rises "stray \26 in program"
error.
Sounds like an error occured in copying the files somewhere. If
you're 100% sure that the only copy error is that one extra
character was appended, the obvious solution is to edit the
files to remove it. A three line script with any decent command
interpreter. Maybe even less. On my system, something like:
for x in ` find . -name '*.cpp' `
do tr -d '\026' $x /tmp/xxx && mv /tmp/xxx $x
done
The syntax will obviously be different for other systems, but
something along those lines should certainly be possible.
Note that if you're using vim, you can also do it in
interactive, with ":argdo s/^Z//g" command.
(I'm just wondering: did you tar the files from a Windows
machine to Unix, using binary instead of ascii. '\26' is the
Windows EOF character, and it is not abnormal for a text file to
contain it as the last character in the file on disk. Reading
in text mode under Windows, however, you won't see it.)
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34