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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 423k
  • Answers 423k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It simply demonstrates that analyzing language behavior by "trying it… May 15, 2026 at 11:46 am
  • Editorial Team
    Editorial Team added an answer Don't call it SURROGATE_KEY. That is meaningless in any other… May 15, 2026 at 11:46 am
  • Editorial Team
    Editorial Team added an answer I'm guessing you're referring to the .NET Micro Framework. You're… May 15, 2026 at 11:46 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.