67 257
Assignments Done
99,3%
Successfully Done
In November 2018

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)
Expert's answer
#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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions