Computing.Net > Forums > Programming > Compiling Errors with C++ / Solaris

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Compiling Errors with C++ / Solaris

Reply to Message Icon

Name: BakaNeko
Date: May 16, 2003 at 14:46:27 Pacific
OS: Solaris
CPU/Ram: PIII 450, 256 mb
Comment:

Hi,

I wrote a C++ program in windows that works perfectly now I need to make it work for Solaris. But, when i compile I get the following error. Not sure what the compile is telling me.

top20.cpp:366: warning: name lookup of `i' changed for new ANSI `for' scoping
top20.cpp:356: warning: using obsolete binding at `i'

The method is:
// Create report
void top20::createReport () {

ofstream outFile;

outFile.open("report.txt");

if (outFile.fail()) {
cout = freq && temp_ip[i] != "" && temp_uploader[i] == true) {
outFile = freq && temp_ip[i] != "" && temp_uploader[i] == false) {
outFile temp_ip[i] " " temp_host_name[i] " " temp_total_size[i]
" " temp_freq[i] endl;

}
}

outFile "\n\n";
outFi---Original Meendl;

outFile.close();
}




Sponsored Link
Ads by Google

Response Number 1
Name: egkenny
Date: May 17, 2003 at 10:15:30 Pacific
Reply:

I have seen that error explained as meaning you used a variable outside of its scope. For example:
---------
for(int i=0;i<100;i++)
{
...
}
index = i; // not valid with new ANSI
---------
With the old standard i was still valid after the for loop. According to the new ANSI standard i goes out of scope after the for loop.


0
Reply to Message Icon

Related Posts

See More


SML help Spondership & Reputat...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Compiling Errors with C++ / Solaris

Compiling Errors with C++ / Solaris www.computing.net/answers/programming/compiling-errors-with-c-solaris/6538.html

Compilation error in C www.computing.net/answers/programming/compilation-error-in-c/12086.html

Compiling Errors in Dev C++ www.computing.net/answers/programming/compiling-errors-in-dev-c-/9484.html