Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 767715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:04:06+00:00 2026-05-14T18:04:06+00:00

error C2065: ‘exam1’ : undeclared identifier // basic file operations #include <iostream> #include <fstream>

  • 0

error C2065: ‘exam1’ : undeclared identifier

// basic file operations
#include <iostream>
#include <fstream>
using namespace std;
void read_file_in_array(int exam[100][3]);
double calculate_total(int exam1[], int exam2[], int exam3[]); // function that calcualates grades to see how many 90,80,70,60
//void display_totals();

int main()
{
    int go,go2,go3;
    go=read_file_in_array(exam);
    go2=calculate_total(exam1,exam2,exam3);
    //go3=display_totals();
    cout << go,go2,go3;
    return 0;
}/*
int display_totals()
{

    int grade_total;
    grade_total=calculate_total(exam1,exam2,exam3);
    return 0;
}   */
double calculate_total(int exam1[],int exam2[],int exam3[])
{
    int calc_tot,above90=0, above80=0, above70=0, above60=0,i,j;
    calc_tot=read_file_in_array(exam);
    for(i=0;i<100;i++)
        {
            exam1[i]=exam[100][0];
            exam2[i]=exam[100][1];
            exam3[i]=exam[100][2];
            if(exam1[i] <=90 && exam1[i] >=100)
                {
                    above90++;
                    cout << above90;
                }
        }
        return exam3[i];

}

void read_file_in_array(double exam[100][3])
{
  ifstream infile;  

  int num, i=0,j=0;
  infile.open("grades.txt");// file containing numbers in 3 columns
    if(infile.fail()) // checks to see if file opended
    {
        cout << "error" << endl;
    }
  while(!infile.eof()) // reads file to end of line
      {
          for(i=0;i<100;i++) // array numbers less than 100
          {
            for(j=0;j<3;j++) // while reading get 1st array or element
            infile >> exam[i][j];
            infile >> exam[i][j];
            infile >> exam[i][j];
            cout << exam[i][j] << endl;
          }
          exam[i][j]=exam1[i];
          exam[i][j]=exam2[i];
          exam[i][j]=exam3[i];

      }
  infile.close();

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:04:07+00:00Added an answer on May 14, 2026 at 6:04 pm
    go=read_file_in_array(exam);
    

    exam is not declared in the scope of main 😕 How about declaring it (perhaps int exam[100][3])

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing error C2065: 'IOCTL_NDISUIO_OPEN_DEVICE' : undeclared identifier error in beneath code. Where
Now I'm getting another error. error C2065: 'temp' : undeclared identifier I know that
The whole error is: Error 1 error C2065: 'socklen_t' : undeclared identifier c:usersricharddocumentsvisual studio
Getting this error: (68): error C2065: 'programend' : undeclared identifier (Off-topic note: I know
I'm getting a compiler error with bind : using namespace std; bool odp(int arg1,
Calling system() to run an external .exe and checking error code upon errors: #include
On executing the following code using 'Macro Definitions Set 1', I encounter the error
I am doing sample using DirectX 9 On Vs 2008/windows7. I am getting error.
How does a copy constructor work in c++ Error 1 error C2064: term does
Error creating bean with name 'sessionFactory' defined in class path resource [ApplicationContext.xml]: Invocation of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.