473,394 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

help to change a letter (C++)

4
Hi,
I am new to C++ program. Pls help me for following problem.
I have a text file as follows,

1 0.845230d+02 0.824650d+02 0.000000d+00
2 0.845230d+02 0.824650d+02 0.000000d+00
3 0.845230d+02 0.824650d+02 0.000000d+00
4 0.845230d+02 0.824650d+02 0.000000d+00
5 0.845230d+02 0.824650d+02 0.000000d+00
6 0.845230d+02 0.824650d+02 0.000000d+00
7 0.845230d+02 0.824650d+02 0.000000d+00

Here I want to change the letter "d" to "e". Pls help me to write a program.

Thanks lot in advance.

Regards,
Sitha.
Aug 2 '06 #1
2 1554
Banfa
9,065 Expert Mod 8TB
This looks like a course work problem, as such I suggest that you attempt to write the program yourself, then post your code here and we will help you debug it. As some hints I would say that you will need to use

File handling functions

fopen
fgets
fclose

Array manipulation (of a char array).


Have an attempt post what you come up with, you will learn more that way.
Aug 2 '06 #2
Hello Sitha,
If your strings have a constant length you can manipulate it as array to locate the 2nd "d" position and simply change it to "e"
Aug 2 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Kelly | last post by:
I want to search for a letter and replace it but when I add the > to the file name it acts up. When I take it out it works but obviously doesn't alter the file only prints it altered. Can anyone...
8
by: Shlomi Schwartz | last post by:
Hi all, Why do I get the folowing date when creating it like so: var d = new Date(2003,9,2); Wed Oct 1 23:00:00 UTC+0200 2003 Isent it soposed to be:
5
by: Maria Joćo | last post by:
I have a table with one field that ia a hyperlink to a pdf file that opens a specific file. Since these files are very big, I would need to change the hyperlink path, so that I could send the...
9
by: Megan | last post by:
Hi- I'm creating a database of music bands with their cds and songs. I'm trying to program an SQL statement so that I can enter a string of text in a textbox, press the 'Enter' key, and have...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
11
by: c19h28o2 | last post by:
Hi, Guy's I know there are several posts about this, however I do not want to read them as answers are undoubtedly posted! Here is my attempt but I'm slightly stuck. I'm not looking for the...
21
by: asif929 | last post by:
I need immediate help in writing a function program. I have to write a program in functions and use array to store them. I am not familiar with functions and i tried to create it but i fails to...
8
by: babyangel43 | last post by:
Hello, I have a query set up in Access. I run it monthly, changing "date of test". I would like this query to be merged with a Word document so that the cover letter is created in Word, the fields...
10
by: aboolamoola | last post by:
hi, I recently started programing about a month ago. my teacher ask me to make a game. A connect 4 game. I try to make, but failed. I need help. here is my code: import java.awt.*; import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.