December 23rd, 2004, 12:55 AM
-
trying to resolve types - help me!!!
Hi guys,
I need to check from a sample cpp program if the foll. declaration exists:
const int *x = new const int;
it has to be replaced as
const int *x = new const int(3);
Problem is if it exists only once in the prg script is working fine.
for multiple occurences there is a problem
used grep cmd to search and then used cut to get the type and then used sed to replace
Plz let me know soon
December 27th, 2004, 04:58 PM
-
Can you use a perl script instead. I might have one lying around that does find/replace on multiple files.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
December 28th, 2004, 12:09 AM
-
no can't use perl
Hi
Thanks for ur reply.But, we can't use PERL.
I tried to read the sample code line by line using a temp file
and then within the while structure i used a case structure for the various occurrences of int,float,double .
with the help of sed statement i replaced new const int with new const int(3) using a variable for the default value.
Problem is only the last done replacement is there. rest everything is overwritten.
What should i do????