Having a problem with strings and pointers in C++?
-
if somebody can further explain an example of the following to me, to help me get a better understanding for my midterm programming file. we have to create a function that creates a strand (of characters) from a string. create a function that makes a strand A->B->C->D->E help please and explain if you can, I know its hard to understand what I am asking, but thats basically all I have
-
Answer:
assuming to mean what I think you mean :\ #include <iostream> #include <string.h> using namespace std; int main() { string theString = "This string should be seen on your screen"; int i = 0; while ( theString[i] != '\0' ) { cout << theString[i] << " - "; i++; } } I just threw that together so it might have a few bugs (havent tested it :p )
SAM JAM at Yahoo! Answers Visit the source
Related Q & A:
- How to convert a char array into an int in C++?Best solution by Stack Overflow
- Would my irrelevant work experience be a problem?Best solution by thestudentroom.co.uk
- There was a problem accessing your account. Please try again in a moment. Error #1?Best solution by Yahoo! Answers
- Which is better, A in an easy class or B/C in a hard class?Best solution by monkeysee.com
- How to tune a new violin strings?Best solution by wiki.answers.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.