Any programmers here?

I have no idea what the majority of that says because I've never taken C++ but I sort of understand what's going on solely because of my psuedo code class. //content.invisioncic.com/y282845/emoticons/crap.gif.7f4dd41e3e9b23fbd170a1ee6f65cecc.gif

 
#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;

}
thats line 44, but I might just figured out my own problem...give me a sec.

 
Your problem is a type mismatch, you are trying to assign an int to a phoneInfo struct.

What is the point of that? Which part of phoneInfo are you trying to set to 0? If you wanna set the phone number to 0, you would do:

for (fill=0; fill

dataArray[fill]->phoneNumber =0;

I don't see why you would have any variation of that code though, you may have done that in the past with an array of ints because you want to avoid garbage values.. but in this case you aren't working with primitive variables and you have to be a little smarter..

Post the desired behavior of the program and then we can help.

 
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
533
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