Help please, just made this little program, no errors but it does not write any text for me on Dev-C++.

#include <iostream>

using namespace std;

int main()
{
    system("title Array Program.");
    
    int myArray[5];
    int loop;
    
    for (loop = 0; loop > 5; loop++)
    {
        cout << "Value for myArray[" << loop <<"] : ";
        cin  >> myArray[loop];
    }
    
    for (loop = 0; loop > 5; loop++)
    
    cout << "#" << loop << " : " << myArray[loop] << endl;
    
    system("PAUSE>nul");
}

Please help?

Recommended Answers

All 3 Replies

Change > to < in your loops. You aren't going through them.

What is this really doing? for (loop = 0; loop > 5; loop++)

this is not a program i am building on, i am learning C++ and looking at sites trying to learn part by part, then trying to rewrite the program without looking at original to try to learn and remember, and thanks for help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.