First  Prev  1  2  3  4  5  Next  Last
Kondo's C++ class
Sensei
10136 cr points
Send Message: Send PM GB Post
24 / M / The Universe is a...
Offline
Posted 8/7/08

fruitschinposamurai wrote:


Nyctophyll wrote:

got it lol


then post your corrections.


i got errors when I typed that way.
Sensei
3193 cr points
Send Message: Send PM GB Post
25 / M
Offline
Posted 8/7/08

Nyctophyll wrote:


fruitschinposamurai wrote:


Nyctophyll wrote:

got it lol


then post your corrections.


i got errors when I typed that way.


I forgot about your different configurations, so just use the other one

cout << a << endl;
cout << b << endl;
cout << c << endl;

Sensei
10136 cr points
Send Message: Send PM GB Post
24 / M / The Universe is a...
Offline
Posted 8/7/08 , edited 8/7/08
ohh!! ok got it

corrections:

Sensei
3193 cr points
Send Message: Send PM GB Post
25 / M
Offline
Posted 8/7/08

Nyctophyll wrote:

ohh!! ok got it

corrections:



you did a good job on ignoring me.
Variables like the one you used a are seen by the computer as a number when you use the cout function. So instead of putting

cout << 1 << endl;
cout << 2 << endl;
cout << 3 << endl;

Copy and Paste this instead!

int a = 1;
int b =2;
int c = 3;
cout << a << endl;
cout << b << endl;
cout << c << endl;

Variable can be outputted onto the screen directly, this is useful because when I show you how to multiply them you could just put the variable instead of the number.
so

int a = 1;
cout << a;

is the EXACT same thing as writing

cout << 1;

because a has a value of 1 in the computers eyes.
NOW fix this!
Sensei
10136 cr points
Send Message: Send PM GB Post
24 / M / The Universe is a...
Offline
Posted 8/7/08 , edited 8/7/08

fruitschinposamurai wrote:


Nyctophyll wrote:

ohh!! ok got it

corrections:



you did a good job on ignoring me.
Variables like the one you used a are seen by the computer as a number when you use the cout function. So instead of putting

cout << 1 << endl;
cout << 2 << endl;
cout << 3 << endl;

Copy and Paste this instead!

int a = 1;
int b =2;
int c = 3;
cout << a << endl;
cout << b << endl;
cout << c << endl;

Variable can be outputted onto the screen directly, this is useful because when I show you how to multiply them you could just put the variable instead of the number.
so

int a = 1;
cout << a;

is the EXACT same thing as writing

cout << 1;

because a has a value of 1 in the computers eyes.
NOW fix this!


yes boss!! thought you refered to the ones with cout only

redo:
#include "stdafx.h"
#include <iostream>
using namespace std;

int main ()
{
int a = 1;
int b =2;
int c = 3;
cout << a << endl;
cout << b << endl;
cout << c << endl;
cin >> b;
return 0;
}
Sensei
3193 cr points
Send Message: Send PM GB Post
25 / M
Offline
Posted 8/7/08

Nyctophyll wrote:

yes boss!! thought you refered to the ones with cout only

redo:
#include "stdafx.h"
#include <iostream>
using namespace std;

int main ()
{
int a = 1;
int b =2;
int c = 3;
cout << a << endl;
cout << b << endl;
cout << c << endl;
char b;
cin >> b;
return 0;
}

as long as you understand. Since you are the only one to do it right you can help people who can't understand it
Sensei
10136 cr points
Send Message: Send PM GB Post
24 / M / The Universe is a...
Offline
Posted 8/7/08

fruitschinposamurai wrote:


Nyctophyll wrote:

yes boss!! thought you refered to the ones with cout only

redo:
#include "stdafx.h"
#include <iostream>
using namespace std;

int main ()
{
int a = 1;
int b =2;
int c = 3;
cout << a << endl;
cout << b << endl;
cout << c << endl;
char b;
cin >> b;
return 0;
}

as long as you understand. Since you are the only one to do it right you can help people who can't understand it

b
tw, do we still need char b? cuz I tried playing with the codes and when without char b it also activates
Sensei
3193 cr points
Send Message: Send PM GB Post
25 / M
Offline
Posted 8/7/08

Nyctophyll wrote:


fruitschinposamurai wrote:


Nyctophyll wrote:

yes boss!! thought you refered to the ones with cout only

redo:
#include "stdafx.h"
#include <iostream>
using namespace std;

int main ()
{
int a = 1;
int b =2;
int c = 3;
cout << a << endl;
cout << b << endl;
cout << c << endl;
char b;
cin >> b;
return 0;
}

as long as you understand. Since you are the only one to do it right you can help people who can't understand it

b
tw, do we still need char b? cuz I tried playing with the codes and when without char b it also activates

Good job I was waiting for someone to figure that out. The line char b; shouldn't be in this program at all because it would mess up the program, as there is already a variable named b.
Sensei
10136 cr points
Send Message: Send PM GB Post
24 / M / The Universe is a...
Offline
Posted 8/7/08

fruitschinposamurai wrote:


Nyctophyll wrote:


fruitschinposamurai wrote:


Nyctophyll wrote:

yes boss!! thought you refered to the ones with cout only

redo:
#include "stdafx.h"
#include <iostream>
using namespace std;

int main ()
{
int a = 1;
int b =2;
int c = 3;
cout << a << endl;
cout << b << endl;
cout << c << endl;
char b;
cin >> b;
return 0;
}

as long as you understand. Since you are the only one to do it right you can help people who can't understand it

b
tw, do we still need char b? cuz I tried playing with the codes and when without char b it also activates

Good job I was waiting for someone to figure that out. The line char b; shouldn't be in this program at all because it would mess up the program, as there is already a variable named b.


thought so cuz i keep getting errors before I deleted them -the answer above was copied right off my answer HAHA!!)
Sensei
3193 cr points
Send Message: Send PM GB Post
25 / M
Offline
Posted 8/7/08

Nyctophyll wrote:

thought so cuz i keep getting errors before I deleted them -the answer above was copied right off my answer HAHA!!)


....wow all respect my for you has disappeared
Sensei
10136 cr points
Send Message: Send PM GB Post
24 / M / The Universe is a...
Offline
Posted 8/7/08
HAHAH!! "it" happens kondo san lol
Student
186 cr points
Send Message: Send PM GB Post
29 / Out there.... to...
Offline
Posted 8/8/08
Can i also post a question about c++? ( btw. i am actually a java developer and i am now studying c++ (C should be not the problem) Or is this forum just for fun? i don't want to annoy anyone
Sensei
10136 cr points
Send Message: Send PM GB Post
24 / M / The Universe is a...
Offline
Posted 8/8/08
yes, this is what forum is about lol you should teach us the java thing also but sign as a teacher though from gintama.
Sensei
3193 cr points
Send Message: Send PM GB Post
25 / M
Offline
Posted 8/9/08

meanyweenie wrote:

Can i also post a question about c++? ( btw. i am actually a java developer and i am now studying c++ (C should be not the problem) Or is this forum just for fun? i don't want to annoy anyone


go ahead, nice to see a fellow programmer (although you are a professional programmer and I am not)
Sensei
3193 cr points
Send Message: Send PM GB Post
25 / M
Offline
Posted 8/11/08
Attention!
I am going to be busy for the next two weeks writing papers (damn my professors), so I won't be able to make any lessons for a while, but if you have any questions or are done with the assignement feel free to post it up here.
First  Prev  1  2  3  4  5  Next  Last
You must be logged in to post.