Thread: C++ Help
View Single Post
Old 06-28-2009, 01:27 PM   #5 (permalink)
Baez
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,475

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: C++ Help

Glad to help man . C++ is my main language because of game design/programming so feel free to ask anything.

Here's your code properly indented and formatted:

Code:
#include <iostream>
using namespace std;

int main()
{
	int i;
	int t;
	int nums[3][4];

	for(t=0; t<3; t++)
	{
		for(i=0; i<4; i++)
		{
			nums[t][i] = (t*4) + i + 1;
			cout << nums[t][i] << ' ';
		}
		cout << '\n';
	}
	return 0;
}
Also I wouldn't suggest using iostream and cout until you learn what namespaces are and how they work. Practicing with printf first helps a ton as it's a pretty powerful function.
__________________


Last edited by Baez; 06-28-2009 at 01:29 PM.
Baez is online now