|
-
September 8th, 2009, 11:30 AM
#1
help with undeclared identifiers
I can't seem to fix this problem, seeing if you guys see anything that I am blindly missing.
I get errors such as:
1>c:\projects\lab2\lab2\word.cpp(64) : error C2065: 'five' : undeclared identifier
1>c:\projects\lab2\lab2\word.cpp(75) : error C2065: 'five' : undeclared identifier
1>c:\projects\lab2\lab2\word.cpp(76) : error C2065: 'twod' : undeclared identifier
and every variable in my string arrays all have the same 'undeclared identifier' error. I am using the 'using namespace std;' so i dont see the problem.
here is a short snippet of my code:
#include <iostream>
#include <iomanip>
#include <string>
#include <stdio>
using namespace std;
int lengths(string* [], string [][]);
int main(){
string* five[5] = {boat, light, gray, mind, soul};
string twod[3][2] = {{cat, dog, hamster},
{bird, monkey, fish}};
int lengths( *five[5], twod[3][2] );
int iei( *five[5], twod[3][2] );
return 0;
}
//Display the length of each string.
int length(string *five[],string twod[][]){
for(int x=0; x<5; x++){
cout << "*five[" << x << "] ";
cout << "has a length of " << five[x].length();
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|