Unknown override specifiers
last name and first name are "unknown override specifier's"...what gives?
I can get this to work without the header.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#pragma once
#include <string>
struct studentInfo {
string firstName;
string lastName;
int age;
int testScores[3];
int arrayLength;
int gpa;
};
void initialize(studentInfo studentInfo[]);
////////////
#include <iostream>
#include "Header1.h"
#include <iomanip>
using namespace std;
int main()
{
studentInfo student[2];
initialize(student);
print(student);
}
void initialize(studentInfo student[]) {
for (int j = 0; j < 2; j++)
{
student[j].firstName = "";
student[j].lastName = "";
student[j].age = 0;
for (int i = 0; i < 3; i++)
{
student[j].testScores[i] = 0;
}
}
}
|
Last edited on
Move line 19
using namespace std;
below line 2
#include <string>
OR
change lines 4 & 5 to explicitly use the standard namespace qualifier:
1 2
|
std::string firstName;
std::string lastName;
|
Last edited on
Topic archived. No new replies allowed.