manutd 2

And because this is C++, #defines should be made const. And he's using C style strings, not std::strings.

manutd 2

[code][COLOR=#008000]#include [/COLOR]
[COLOR=#008000]#include [/COLOR]
[COLOR=#008000]#include [/COLOR]
[COLOR=#008000]#include [/COLOR][/code]
O-o-outdated. It's:[COLOR=#008000] [/COLOR][code]
[COLOR=#008000]#include [/COLOR]
[COLOR=#008000]#include [/COLOR]
[COLOR=#008000]#include [/COLOR]
[COLOR=#008000]#include [/COLOR]
[/code]

manutd 2 Junior Poster

This is a simple rock paper scissors game using random numbers.

manutd 2

1) This void main() Should be int main( void )
2)Try to eliminate the nonstandard functions.

manutd 2

Use code tags!

manutd 2

Welcome, my pleasure :)

manutd 2

[INLINECODE]void main()[/INLINECODE]Should be [INLINECODE]int main (void)[/INLINECODE]

manutd 2

How about you don't double post code snippets?

manutd 2

It will compile and work, at least for me. [n] and [n-1] in that section produce the same output for me. I'm using wxDev-C++.
EDIT: In fact, this causes it to output n (1) twice, which is incorrect.

manutd 2 Junior Poster

This is a function that will find the factors of a given number for you.
EDIT: Better algorithm using vectors (thanks all at cprog :) )

manutd 2

Main really should have a type: [INLINECODE]int main ( void )[/INLINECODE]

manutd 2

Is this C++ code? It looks like C code.

manutd 2

This [inlinecode][COLOR=#0000ff]void[/COLOR] mainCOLOR=#000000[/COLOR][/inlinecode]should be [inlinecode]int main(void)[/inlinecode]. Try to find alternatives to using clrscr, etc, as they are non-portable.

manutd 2

6) Take out the .h's:
[INLINECODE]include
//etc...[/INLINECODE]

manutd 2

1)Main should have a type: [INLINECODE]int main (void)[/INLINECODE]
2) O-o-out dated: [INLINECODE][COLOR=#0000ff]goto[/COLOR] begin;[/INLINECODE]
3) What's with the indentation?
4) Seed rand only once, at the start of the app.
5) Could you have made this any less portable?

manutd 2

Main should have a type [INLINECODE]int main (void)[/INLINECODE]

manutd 2

There are some outdated elements (goto), non-portable ones (system("PAUSE"), and a complete lack of indentation.

manutd 2

You may want to take out the non-standard functions and headers (getch(), etc).

manutd 2

Hiv->aids

manutd 2

pinochio -> pistachio

manutd 2

How did you get hired? The point of work is, wait for it, TO WORK! Not to kill your "friend's" computer, and not to waste the companies resources.

manutd 2

ant eater -> wierd nose

manutd 2

emotions -> psychology

manutd 2

Sharky, please, no more bold! You're making my eyes bleed...

manutd 2

I need to ask: why are you in a chinese university if you don't know chinese?

manutd 2

Which is good, of course, in case some odd operating system decides that 74 is a good value to indicate success, and that 0 will be failure.

manutd 2

catastrophe -> death :cry:

manutd 2

[quote="WoBinator"]Do i need to learn 'assembly language' before c++? or VB.Net?
[/quote]N-o-o-o. Assembly language is probably the last language you will learn. It also happens to be the least forgiving and least user-friendly. Happiness ;) It is best used in low level, OS base type programming (aka in situations other languages just won't do).

manutd 2

fell short this time -> broken leg

manutd 2

If you like C or C++, look at the recommended books in that forum.
Another compiler: Code::Blocks.