UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old December 22nd, 2004, 11:55 PM
sukum81 sukum81 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: HYD
Posts: 2 sukum81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 49 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old December 27th, 2004, 03:58 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,440 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 50 m 56 sec
Reputation Power: 797
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

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
  #3  
Old December 27th, 2004, 11:09 PM
sukum81 sukum81 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: HYD
Posts: 2 sukum81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 49 sec
Reputation Power: 0
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????

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > trying to resolve types - help me!!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway