User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 423,452 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,705 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 2206 | Replies: 6
Reply
Join Date: Feb 2007
Posts: 7
Reputation: ctrohana is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ctrohana ctrohana is offline Offline
Newbie Poster

Enter string to the next line

  #1  
Feb 28th, 2007
Hi guys,
I need ur help.
If I have character strings (data array file) as below:

X001234
X001345Y002323
X00142
X001567

How do i program, if I want to enter Y002323 to the next line? and how I can add '0' character after X00142 so that the the array is like this:

X001234
X001345
Y002323
X001420
X001567

thanks a lot .

-ct
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 166
Reputation: Lazaro Claiborn is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 13
Lazaro Claiborn's Avatar
Lazaro Claiborn Lazaro Claiborn is offline Offline
Junior Poster

Re: Enter string to the next line

  #2  
Feb 28th, 2007
Originally Posted by ctrohana View Post
Hi guys,
I need ur help.
If I have character strings (data array file) as below:

X001234
X001345Y002323
X00142
X001567

How do i program, if I want to enter Y002323 to the next line? and how I can add '0' character after X00142 so that the the array is like this:

X001234
X001345
Y002323
X001420
X001567

thanks a lot .

-ct



Software, what a wonderful thing. The hardware that exists within our computer act as a super highway on which our software composed of ones and zeros propagate, giving hardware its true purpose. Such control is rather compelling, in that we determine the computers fate, define its purpose and guide its destiny. How does Software work? What is this beautiful thing known as Software? What do I need to know in order to write Software?


As a result of the accepted “Von Neumann” architecture, hardware that perform specific tasks receive instructions in binary form that instruct the specific peice of hardware what to do and perhaps how to do it (i.e. Options). The CPU (Central Processing Unit) of a computer does essentially that; it reads instructions from RAM (Random Access Memory) and acts depending on the instruction extracted. The “instruction” set of a given processor is a complete list of valid instructions the processor accepts. Basically the software we develop, using what ever programming language, are broken down into sequences of instructions defined for an instruction set.


Computers use something known as an OS (Operating System) such as Microsoft Windows or Linux, which is the software that knows how all the device work in the system and how to interact with those devices. OS's provide API (Application Programming Interfaces) which is composed of software programming code that software developers use so that they can write application programs that indirectly interact with the devices in a system; the OS acts as an intermediary. Once we know a programming language that can be used along with the API's of an OS we can then use our creative minds to tell a computer to do some interesting stuff, through software. At which point, we see the true beauty of Software.


As explained above, each processor has its own instruction set used to instruct the processor. As a consequence lower level programming (i.e Assembly) which are made up of Mnemonics, labels that represent a given instruction so we don't have to write a bunch of binary code, are unique to its processor counterpart. So high-level programming languages were invented which provide even more human readable symbols and a “compiler” that translates your high level “source code” into the Assembly that is specific to you CPU. This allows you to write software code without worrying about the spec's of you computer system.


The first thing you'll need to do is learn a programming language, a high level one if you're a newbie, during which you should learn about your OS's standard library which you'll probably initially use instead of using the raw OS API libraries; The standard library wraps the raw API's. A good language to learn for newbies would be something like Visual Basic or Java. Then you can move onto more difficult high level languages such as C or C++ , which allow for more precise functions and operations to be defined, and much more. Also, while you're learning a programming language you'll probably want to download an GUI (Graphical User Interface) IDE (Integrated Development Environment) that you can use to practice; the GUI IDE is usually easier to use and more intuitive, as opposed to a command line compiler. Now you can start your programming journey, eventually becoming a programming master.


While you're on your journey, you can sign up with many web forums where you can post questions and problems, or post suggestions and ideas. This is a great resource that has helped so many already, so it'd be a good idea. Once you've learned a language you'll notice it is easier to learn others because you've learned the basic concepts of programming in general. All you'd need to do is learn the languages syntax and semantics. Learn the language, express yourself through your programming and become a master at the art.

Good luck, LamaBot
Last edited by Lazaro Claiborn : Feb 28th, 2007 at 10:23 pm.
Reply With Quote  
Join Date: Apr 2006
Location: Canada
Posts: 4,500
Reputation: John A is a glorious beacon of light John A is a glorious beacon of light John A is a glorious beacon of light John A is a glorious beacon of light John A is a glorious beacon of light John A is a glorious beacon of light 
Rep Power: 17
Solved Threads: 275
Moderator
Featured Blogger
John A's Avatar
John A John A is offline Offline
Vampirical Moderator

Re: Enter string to the next line

  #3  
Feb 28th, 2007
@Lazaro: Did you mistakenly post your reply to the wrong thread? ^_^
tuxation.com - Linux articles, tutorials, and discussions
Reply With Quote  
Join Date: Jan 2007
Posts: 166
Reputation: Lazaro Claiborn is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 13
Lazaro Claiborn's Avatar
Lazaro Claiborn Lazaro Claiborn is offline Offline
Junior Poster

Re: Enter string to the next line

  #4  
Feb 28th, 2007
Originally Posted by joeprogrammer View Post
@Lazaro: Did you mistakenly post your reply to the wrong thread? ^_^


@Joeprogrammer: Just thought I'd guide the newbie and give him some incentive. Please don't tell. :lol: I mean.... crap, I did!

LamaBot

P.S. You need to teach me ascii art; through PM of course. Hehe.
Last edited by Lazaro Claiborn : Feb 28th, 2007 at 10:29 pm.
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,851
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 344
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: Enter string to the next line

  #5  
Mar 2nd, 2007
I guess Lamabot's reply should be used as a template for those who are in need of ready code.... its less sarcastic, snappy and cocky.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Join Date: Jan 2007
Posts: 166
Reputation: Lazaro Claiborn is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 13
Lazaro Claiborn's Avatar
Lazaro Claiborn Lazaro Claiborn is offline Offline
Junior Poster

Re: Enter string to the next line

  #6  
Mar 2nd, 2007
Originally Posted by ~s.o.s~ View Post
I guess Lamabot's reply should be used as a template for those who are in need of ready code.... its less sarcastic, snappy and cocky.


Actually it was a mistake to post that there, I meant to post it in the blogs window I had open. I'm actually not experienced enough to be cocky. The sarcastic perception is direct result of my post for the newbie. Sorry, I wish I could delete it or edit it.

LamaBot
Last edited by Lazaro Claiborn : Mar 2nd, 2007 at 8:25 am.
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,851
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 344
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: Enter string to the next line

  #7  
Mar 2nd, 2007
Originally Posted by Lazaro Claiborn View Post
Actually it was a mistake to post that there, I meant to post it in the blogs window I had open. I'm actually not experienced enough to be cocky. The sarcastic perception is direct result of my post for the newbie. Sorry, I wish I could delete it or edit it.

LamaBot

Oh, you are gettting me all wrong. I was just joking. It really was an interesting read.

Do you seriously want to edit it out ? If so, I would need to fill it with something, so that the continuity is not broken.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 2:50 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC