Answer to Question #3819 in C++ for Antuan

Question #3819
How can I get user input in c++ to pass to a function that accepts char*? ie addRecord(char* lName, char* fName, char grade)
1
Expert's answer
2011-08-04T05:50:51-0400
#include <iostream>using namespace std;

void addRecord(char* lName, char* fName, char grade){
// addRecord method body
}
int main(int argc, char** argv)
{
char lName[20];
char fName[20];
char grade;

cout << "Enter 'lName'" << endl;
cin >> lName;

cout << "Enter 'fName'" << endl;
cin >> fName;

cout << "Enter 'grade'" << endl;
cin >> grade;
cout << lName;

addRecord(lName, fName, grade);
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS