c++ programs (1 Viewer)

Rahul

Dead Member
Joined
Dec 14, 2002
Messages
3,647
Location
shadowy shadows
can ppl post their programs(jus the code), so we can learn new things?

here is mine anyway....its really crap and not even complete, 'sum' bugs.

oh and u need to zip it so it can be uploaded(use winzip or winrar)
 

:: ck ::

Actuarial Boy
Joined
Jan 1, 2003
Messages
2,414
Gender
Male
HSC
2004
Heres my VB code

IF ryan_is_in_year_12 = True THEN
ryan_will_post_code = True
ELSE
ryan_will_post_code = False
END IF

haha sorry i have nothing to contribute but your thread seemed so lonely :p
 

Rahul

Dead Member
Joined
Dec 14, 2002
Messages
3,647
Location
shadowy shadows
lonely it is....

my new module:

newProgram()
{
int x = 5

while (x > 0)
{
everyone sucks;
i am the best coder on these forums;
}

}
 

tieki

Member
Joined
Feb 17, 2003
Messages
240
Location
"The 'Wong..." :-)
HTML is easier for writing fun things...

!!school = !!trouble;
if (school = trouble)
Sleep(1000);

That about sums it up...or maybe this:

tieki = 1;
Rahul = 0;
:: ryan.cck :: = 0;
Cyph = 0;

cout << "Maybe we should write this entire thread in code...lol" << endl;
 

tieki

Member
Joined
Feb 17, 2003
Messages
240
Location
"The 'Wong..." :-)
void Post()
{
string thread;
thread = "crap";

cout << "This thread is ";

do
{
cout << thread << " ";
}
while (thread == "crap")

// Comments are a good way of cheating...lol
}
 

Rahul

Dead Member
Joined
Dec 14, 2002
Messages
3,647
Location
shadowy shadows
now in all seriousness...can ppl post their progs please....it can b helpful to many ppl.

i am sure that ppl have some programs!
 

tieki

Member
Joined
Feb 17, 2003
Messages
240
Location
"The 'Wong..." :-)
I have mine, but its not nearly finished, and it's still in separately coded pieces...when it's altogether, in the next couple of weeks, I will post it up...

:)
 

tieki

Member
Joined
Feb 17, 2003
Messages
240
Location
"The 'Wong..." :-)
BTW, Rahul, i count 11 errors and 1 warning with ur code.cpp code...something I'm doing wrong? I just compiled it into a default workspace...

Errors:
Code:
--------------------Configuration: code - Win32 Debug--------------------
Compiling...
code.cpp
c:\documents and settings\kieran\desktop\code.cpp(55) : error C2065: 'clock_t' : undeclared identifier
c:\documents and settings\kieran\desktop\code.cpp(55) : error C2146: syntax error : missing ';' before identifier 'start_time'
c:\documents and settings\kieran\desktop\code.cpp(55) : error C2065: 'start_time' : undeclared identifier
c:\documents and settings\kieran\desktop\code.cpp(55) : error C2065: 'cur_time' : undeclared identifier
c:\documents and settings\kieran\desktop\code.cpp(56) : error C2065: 'clock' : undeclared identifier
c:\documents and settings\kieran\desktop\code.cpp(57) : error C2065: 'CLOCKS_PER_SEC' : undeclared identifier
c:\documents and settings\kieran\desktop\code.cpp(132) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is n
o acceptable conversion)
c:\documents and settings\kieran\desktop\code.cpp(136) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is n
o acceptable conversion)
c:\documents and settings\kieran\desktop\code.cpp(139) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is n
o acceptable conversion)
c:\documents and settings\kieran\desktop\code.cpp(147) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is n
o acceptable conversion)
c:\documents and settings\kieran\desktop\code.cpp(194) : warning C4129: 's' : unrecognized character escape sequence
c:\documents and settings\kieran\desktop\code.cpp(321) : error C2146: syntax error : missing ';' before identifier 'start_time'
Error executing cl.exe.

code.obj - 11 error(s), 1 warning(s)
 
Last edited:

tieki

Member
Joined
Feb 17, 2003
Messages
240
Location
"The 'Wong..." :-)
Just looked at your hello.cpp one, that worked fine...a command you could use, though:

#include <stdlib.h>
.
.
.
system("CLS");

Put in the system("CLS") code whenever you want to clear the screen...it makes for a neater program. Another would be:

#include <windows.h>
.
.
.
Sleep(1000);

Substitute 1000 for the number of milliseconds (1000 = 1 second), and your program will wait for that amount of time before going to the next command.

:)
 

Rahul

Dead Member
Joined
Dec 14, 2002
Messages
3,647
Location
shadowy shadows
Originally posted by tieki
Just looked at your hello.cpp one, that worked fine...a command you could use, though:

#include <stdlib.h>
.
.
.
system("CLS");

Put in the system("CLS") code whenever you want to clear the screen...it makes for a neater program. Another would be:

#include <windows.h>
.
.
.
Sleep(1000);

Substitute 1000 for the number of milliseconds (1000 = 1 second), and your program will wait for that amount of time before going to the next command.

:)
thanks! it works fine on my comp!! maybe its on a diff platform....i had to change it for the macs at my school....altho it works on my comp fine.
 

Rahul

Dead Member
Joined
Dec 14, 2002
Messages
3,647
Location
shadowy shadows
Originally posted by Cyph


You're such a great coder you chuck an infinite loop! ;)
oh cool! so u agree that "u all suck" and "i am the greatest coder" for an infinite loop of time....muahhahaa

lol@ryan....ur comp is obviously crap as it cannot handle teh complex programming of the greatest coder on these forums
 

:: ck ::

Actuarial Boy
Joined
Jan 1, 2003
Messages
2,414
Gender
Male
HSC
2004
Originally posted by Rahul


oh cool! so u agree that "u all suck" and "i am the greatest coder" for an infinite loop of time....muahhahaa

lol@ryan....ur comp is obviously crap as it cannot handle teh complex programming of the greatest coder on these forums
i recken 2.8Ghz 1024 ram gf4 and 120gb drive... grr :mad:

i need a better computer :(
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top