Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

My awesome C++ triangle

Name: GOD_HATES_THE_JEWS 2012-02-18 10:49

//Homework 2, question 5

#include <iostream>
using namespace std;

int main(void)
{
 int n;
 int r, c;

 cout << "Enter a number: ";
 cin >> n;
 
 n = 2 * n + 2;
 
 for (r = 1; r <=n; r++, cout << endl)
     for (c = 1; c <=n; c++)
         cout << (r==1 || r==n || c==1 || c==n
              || r >= c || (r+c < n+1) ? ' ' : '*');

 return 0;  
}

Name: Anonymous 2012-02-20 21:05

>>77
I'm not that one that said 'return' was the error.
I said it was ONE of the errors. Please if you're going to quote my previous posts then quote them correctly.

The fact that a shitty compiler accepts it doesn't make it any betters. GCC will accept compile functions with no return when they should have one as well.

You shouldn't be proud about how your shitty mistake will work with shitty compilers.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List