hi everybody. Todays question from me is how do you use arrays to get a string ?
i now about arrays and how to use them, but what about using them with strings.
well i want to get an array of char's which is easy but i want to display them as a string so an array of my name {c, h, r, i, s, t, o, p, h, e, r} them output that as christopher.
@ Veltas: Because they are meant to be able to change their length during runtime with minimal effort. It's a loose definition but one that I stick with.
well basically in a program that may ask you to spell your name but it stores it in a char variable that is an array so, char name[11]; and then i would want to output that name back to you like cout << name[11]; but that would display individual characters so how would you display the whole array without writing all of the parts of the array.
sorry for being a bit un-clear
Maybe I should be more careful with what I type to avoid initial confusion, but in this instance nothing that he may have picked up from me will be harmful. He has a LONG way to go and trying to explain namespaces to the OP at this point WOULD be harmful to their development.
@GodPyro, I know, but the newbie doesn't; perhaps you can see my concern.
@Computergeek01 I didn't suggest to explain namespaces, I just suggested that maybe leaving std:: out would be safer since he mentioned cout before and so he's probably adding using namespace std; to the top of all his files right now. Saying std::cout rather than cout might make a newbie think you're using something different.