forgot all my C/C++

OS

Lifer
Oct 11, 1999
15,581
1
76
So, I have a problem I think can be readily solved with the right computer program. I am taking a look through my old college class examples, and I realized I have forgotten everything and I don't even remember how to make a program add 1+1. This is going to suck.
 

agnitrate

Diamond Member
Jul 2, 2001
3,761
1
0
#include <iostream.h>

int main() {

int x,y;

x = y = 1;

printf("1 + 1 = %d\n", x+y);

return 0;

}
 

MAME

Banned
Sep 19, 2003
9,281
1
0
int x = 1 + 1;

or
int x, y;
x = 1;
y = 1;
x = x + y;

or
int x;
cin >> x;

or
x = 1;
x++;

or
x = 1;
x += 1;

or......
 

MAME

Banned
Sep 19, 2003
9,281
1
0
Originally posted by: agnitrate
#include <iostream.h>

int main() {

int x,y;

x = y = 1;

printf("1 + 1 = %d\n", x+y);

return 0;

}

ewwwww........c
 

OS

Lifer
Oct 11, 1999
15,581
1
76
If I am doing a program as a personal project and I don't care about object oriented, public/private variables, does it matter if I use C or C++?
 

BornStar

Diamond Member
Oct 30, 2001
4,052
1
0
Originally posted by: agnitrate
#include <iostream.h>

int main() {

int x,y;

x = y = 1;

printf("1 + 1 = %d\n", x+y);

return 0;

}
I would have done #include <stdio.h>
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
Originally posted by: OS
If I am doing a program as a personal project and I don't care about object oriented, public/private variables, does it matter if I use C or C++?

no it doesnt.
 

MAME

Banned
Sep 19, 2003
9,281
1
0
Originally posted by: BornStar18
Originally posted by: MAME
c++ is easier
Says who? It all depends on your background.

well, from my experience: c++ is much easier to get good with in a short amount of time as it allows for more slop. Also, it's easier to remember cout << "blah"; than it is to remember printf("%s %d %c", v1, v2, v3); (I probably even messed that up)


If you know both equally well, then go for either or. Otherwise, stick with c++
 

OS

Lifer
Oct 11, 1999
15,581
1
76
Originally posted by: Ameesh
Originally posted by: OS
If I am doing a program as a personal project and I don't care about object oriented, public/private variables, does it matter if I use C or C++?
no it doesnt.


great thx.

does anyone know if C or C++ has built in calculus libraries?


 

MAME

Banned
Sep 19, 2003
9,281
1
0
Originally posted by: OS
Originally posted by: Ameesh
Originally posted by: OS
If I am doing a program as a personal project and I don't care about object oriented, public/private variables, does it matter if I use C or C++?
no it doesnt.


great thx.

does anyone know if C or C++ has built in calculus libraries?

good question. I would imagine there are some but you might have to download them.
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
Originally posted by: OS
Originally posted by: Ameesh
Originally posted by: OS
If I am doing a program as a personal project and I don't care about object oriented, public/private variables, does it matter if I use C or C++?
no it doesnt.


great thx.

does anyone know if C or C++ has built in calculus libraries?

no, it doesn't but you can check out http://www.nr.com/ for some source code , it probably has what you are looking for.
 

bolido2000

Diamond Member
Dec 3, 2001
3,720
1
0
Originally posted by: OS
Originally posted by: Ameesh
Originally posted by: OS
If I am doing a program as a personal project and I don't care about object oriented, public/private variables, does it matter if I use C or C++?
no it doesnt.


great thx.

does anyone know if C or C++ has built in calculus libraries?

You can use Matlab libraries. The exe will be self contained (no need of matlab to run)
 

OS

Lifer
Oct 11, 1999
15,581
1
76
Originally posted by: bolido2000
Originally posted by: OS
Originally posted by: Ameesh
Originally posted by: OS
If I am doing a program as a personal project and I don't care about object oriented, public/private variables, does it matter if I use C or C++?
no it doesnt.


great thx.

does anyone know if C or C++ has built in calculus libraries?

You can use Matlab libraries. The exe will be self contained (no need of matlab to run)


I love Matlab, I use it instead of the windows built in blue "calculator". It's probably overkill, but I use it to figure out the total for the deposit slip on several checks before I go to the bank. :D
 

MAME

Banned
Sep 19, 2003
9,281
1
0
Originally posted by: Ameesh
Originally posted by: OS
Originally posted by: Ameesh
Originally posted by: OS
If I am doing a program as a personal project and I don't care about object oriented, public/private variables, does it matter if I use C or C++?
no it doesnt.


great thx.

does anyone know if C or C++ has built in calculus libraries?

no, it doesn't but you can check out http://www.nr.com/ for some source code , it probably has what you are looking for.

good to know