My function ends with:
return letter[count];
It is supposed to return a character for letter0, letter1, letter2...
This is my entire function:
char assignletters (int v[100], int j)
{
char letter[30];
for (int count=0; count%26lt;j; count++){
if (v[count]%26gt;92)
letter[count]='A';
if (v[count]%26gt;82)
letter[count]='B';
if (v[count]%26gt;72)
letter[count]='C';
if (v[count]%26gt;64)
letter[count]='D';
if (v[count]%26lt;65)
letter[count]='F';
cout%26lt;%26lt;"Grade"%26lt;%26lt;"/t"%26lt;%26lt;"Letter"%26lt;%26lt;endl;
cout%26lt;%26lt;v[count]%26lt;%26lt;"/t"%26lt;%26lt;letter[count];
return letter[count];
}
}
How do I get it to return a character for letter0, letter1, letter2 (the array)?
Thanks!
How do I make a function return a char array?
Change your function signature to return a char array, rather than a single char.
char[] assignletters (int v[100], int j)
{
}
Reply:try using pointers
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment