Any programmers here?

Haha, well it's nearing the end of the semester and it's getting weirder that's for sure.
It doesn't get easier. I used to just copy the programs from other people. My final was to right 100 programs. I turned in 60 copied ones. //content.invisioncic.com/y282845/emoticons/laugh.gif.48439b2acf2cfca21620f01e7f77d1e4.gif I really expected to fail.

 
#include

#include

#include

using namespace std;

const int ARRAY_SIZE = 1000;

struct phoneInfo

{

string name;

string phoneNumber;

int counter;

};

int main()

{

phoneInfo dataArray[ARRAY_SIZE];

ifstream inFile;

string fileName;

cout

cin >> fileName;

inFile.open (fileName.c_str () );

if (!inFile)

{

cout

system("pause");

return 1;

}

cout

int fill;

for (fill=0; fill

dataArray[fill]=0;

cout

system("pause");

return 0;

}

 
int fill;

for (fill=0; fill

dataArray[fill]=0;

I dont have a compiler, but try this:

for (int fill=0; fill

dataArray[fill]=0;

Initialize it within the for loop, not outside...even if that is not the error, it is neater coding.

 
int fill;
for (fill=0; fill

dataArray[fill]=0;

I dont have a compiler, but try this:

for (int fill=0; fill

dataArray[fill]=0;

Initialize it within the for loop, not outside...even if that is not the error, it is neater coding.
This is not the error, but it is neater, what is line 44?

 
Activity
No one is currently typing a reply...

About this thread

.::DuD3::.

10+ year member
EE in training
Thread starter
.::DuD3::.
Joined
Location
Chesafreak, Va
Start date
Participants
Who Replied
Replies
20
Views
531
Last reply date
Last reply from
lilmaniac2
IMG_20260506_140749.jpg

74eldiablo

    May 22, 2026
  • 0
  • 0
design.jpeg

WNCTracker

    May 22, 2026
  • 0
  • 0

New threads

Top