![]() |
| ||
| Pls help me... in array problem.. helow, can someone help me with my problem. my Teacher give me a problem, he want me to make an array that the output would be my name, buth with a space on it, example: Raymond output: R a y m o n d & R a y m o n d using array,, pls help me i dont know how to start. im just new with this type of problem... |
| ||
| Re: Pls help me... in array problem.. Write down on a piece of paper the steps, from start to finish to get the job done. For example, 1) Prompt user for name; 2) Store name in char array/ std::string. 3) Get length of name... etc |
| ||
| Re: Pls help me... in array problem.. I just got some kind of solution, I think it would work. Try this out, and please tell me if it does the job. Cause I'm a new guy too :) [ #include <iostream>] |
| ||
| Re: Pls help me... in array problem.. Quote:
That should be int main() >for ( int i = 0; i < strlen ( name ); i++ ) It is expensive using strlen() within a for loop like that, I by that I don't mean $$. It also doesn't help doing somebody else's homework. |
| ||
| Re: Pls help me... in array problem.. Man, I realise that you could solve the problem right away, I know you guys are experienced and these problems are too easy for you. I just wanted to help the dude like some of you guys helped me. And now that he's got the solution, he can look at it, and get new ideas and maybe surprise his teacher, who knows :) |
| ||
| Re: Pls help me... in array problem.. Quote:
|
| ||
| Re: Pls help me... in array problem.. OK, I won't do this again, I promise. And dude, try to understand the solution. it wasn't easy for me to write it, I'm a newbie you know. |
| All times are GMT -4. The time now is 4:27 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC