What is the problem with pointers in c?

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

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

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.