943,778 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 4247
  • C++ RSS
Feb 28th, 2007
0

Enter string to the next line

Expand 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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ctrohana is offline Offline
7 posts
since Feb 2007
Feb 28th, 2007
0

Re: Enter string to the next line

Click to Expand / Collapse  Quote originally posted by ctrohana ...
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 11:23 pm.
Reputation Points: 11
Solved Threads: 13
Junior Poster
Lazaro Claiborn is offline Offline
171 posts
since Jan 2007
Feb 28th, 2007
0

Re: Enter string to the next line

@Lazaro: Did you mistakenly post your reply to the wrong thread? ^_^
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
Feb 28th, 2007
0

Re: Enter string to the next line

@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 11:29 pm.
Reputation Points: 11
Solved Threads: 13
Junior Poster
Lazaro Claiborn is offline Offline
171 posts
since Jan 2007
Mar 2nd, 2007
0

Re: Enter string to the next line

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.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006
Mar 2nd, 2007
0

Re: Enter string to the next line

Click to Expand / Collapse  Quote originally posted by ~s.o.s~ ...
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 9:25 am.
Reputation Points: 11
Solved Threads: 13
Junior Poster
Lazaro Claiborn is offline Offline
171 posts
since Jan 2007
Mar 2nd, 2007
0

Re: Enter string to the next line

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.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Easy question: Decimals to time
Next Thread in C++ Forum Timeline: Array Initialization





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC