Guest
here is an example of the code I am trying
to use... as it goes through the interations
of populating the uNameCpy, the data in the
original variable gets screwed up...
[tt]
#include <iostream.h> // cout/cin, etc
#include <stdlib.h> // for conversion functions
#include <string> // include for C++ standard string class
#include <conio.h> // for video stuff (like clrscr)
int main()
{
char uName[30], uNameCpy[30];
cin >> uName;
//charcrlf;
//getch();
//crlf = cin.get();
cnt=1;
cntCpy=0;
do
{
uName[cnt]=uNameCpy[cnt];
cnt++;
}
while (cnt < 5);
cout << "You Entered: " << uName << "\n";
return 0;
}
[/tt]
...could anyone help me understand why this
isnt working as I thought it should?
thankx,
myAvatar
to use... as it goes through the interations
of populating the uNameCpy, the data in the
original variable gets screwed up...
[tt]
#include <iostream.h> // cout/cin, etc
#include <stdlib.h> // for conversion functions
#include <string> // include for C++ standard string class
#include <conio.h> // for video stuff (like clrscr)
int main()
{
char uName[30], uNameCpy[30];
cin >> uName;
//charcrlf;
//getch();
//crlf = cin.get();
cnt=1;
cntCpy=0;
do
{
uName[cnt]=uNameCpy[cnt];
cnt++;
}
while (cnt < 5);
cout << "You Entered: " << uName << "\n";
return 0;
}
[/tt]
...could anyone help me understand why this
isnt working as I thought it should?
thankx,
myAvatar