Apr 26, 2011 at 11:13pm UTC
I'm sure it's something simple, but why is my printNewLine function being skipped?
#include<iostream>
using namespace std;
void printStar(int);
void printNewLine();
int main()
{
int side;
cout << "Enter side: ";
cin >> side;
for (int j = 0; j < side; j++)
{
printStar(side);
}
printNewLine();
cout << "PROGRAM ENDS" << endl;
return 0;
}
void printStar(int side)
{
cout << "*";
}
void printNewLine()
{
cout << endl;
}
I get the ***** that equals the number input by user, but no newline. I feel like an idiot. Any help would be great. Thanks.
Apr 26, 2011 at 11:51pm UTC
Wow. I feel even more stupid now. You guys are right. Sorry to waste you time. It's been a long day. I was looking for a blank line after the ***** for some reason. Thanks.