#include <iostream> using namespace std; int main() { int i ; for ( i = 1 ; i < 10; i++ ) { if ( i = 6 ) { cout << "Error.Exclude Number 6" << endl ; } cout << "Loop iteration: " << i << endl ; system("PAUSE"); } return 0; }
#include <iostream> using namespace std; int main() { int i ; for ( i = 1 ; i < 4; i++ ) { cout << "Loop iteration: " << i << endl ; if ( i = 2 ) cout << "Error.Exclude Number 2" << endl ; system("PAUSE"); } return 0; }While I'm here I might as well ask a few more questions!...
- What are the rules for the { } symbols in C++ in terms of spacing and leaving blank lines between the next { or }? Also do I need to have a gap before a semi-colon placed at the end of a line?
- I am still trying to fully understand pointers and addresses. I was told that if I use these on my pc it will change things on my physical memory and HDD. Is this true?
- Is anyone using any non Microsoft C++ compliers in Windows 7 64-bit? I tried CodeBlocks but it didn't work. I have figured something out in Linux but Windows is the issue for now.
Thanks.