char fname[16];
char oname[16];
//then i get input from the user
in = 5;
int now = 0;
while((char)inputs[in] != ' ')
{
fname[now] = inputs[in];
in++;
now++;
}
for(int i = now - 1; i < 16; i++)
{
fname[now] = '\0';
}
cout << fname << endl;
in++;
now = 0;
while((char)inputs[in] != ' ')
{
oname[now] = inputs[in];
now++;
in++;
}
cout << oname << endl;
// it prints out fine here but when it goes out here
cpin(fname,oname);
1 2 3 4 5 6 7
void cpin(char * filename, char * name)
{
cout << filename << endl;
int two;
cin >> two;
//it prints random gibberish here
Im on a tight schedule :P i thought this would be the easy part of the project :(
aah.. i haven't used dev++ but I think concept of debugger is the same.
What you can do is, look for a watch window in your debugger (if its a GUI debugger) and add watch on filename and fname.
Now when you call this function,
cpin(fname,oname);
see the value of fname in the watch window.
Now when the code enters the function, see the value of filename. Now if the debugger shows wrong value or garbage value of fname, this means you are not passing a correct value to cpin and its showing garbage. let us know what are your findings.