What is it?
Is there a site of book that lists errors and the meanings behind them? I'm using bcc55, comandline. Thanx again
What is it?
Is there a site of book that lists errors and the meanings behind them? I'm using bcc55, comandline. Thanx again
it means the compiler can't find it. usually it's spelling error, misuse of a function, missing header or something like that.
If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?
I think I figured it out? (It runs anway). But if I can ask a follow up. Why, when you call a function w/ an array as input, do you not specify an offset, but when you define the function you have to write the offset in?
Here's the code, look for the ????
main()
{
struct planet system[max];//intlz array type struct planet
int loop1;//control
for(loop1=0;loop1<max;loop1++)//gather multi entries
{
system[loop1]=f_gather_data();//f_gather_data call
}
cout<<endl;
f_show_data(system);//????
return (0);
}
void f_show_data(struct planet data[max])//?????
{
int loop2;
cout<<tab<<tab<<"Planet"<<tab<<"Distance"<<endl;
for(loop2=0;loop2<max;loop2++)
{
cout<<tab<<tab<<data[loop2].name<<tab;
cout<<data[loop2].distance<<endl;
}
cout<<endl;
}
You don't need to and you shouldn't.
Secondly, you're using C++ so you don't need the struct identifier infront of your planet type declarations, that's a C thing.
The function prototype should look like this:
What you are passing is actually a pointer to a block of memory so it could also be written like this:Code:void f_show_data( planet data[] );
The name of the array is actually a pointer to the first index of the array. The [] allow you to get a value from a specific index without having to use pointer notation to get to it.Code:void f_show_data( planet *data );
And use code tags when posting or an attachment if it's large.
If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?