Let's write a program in c++ Sup Forums

Let's write a program in c++ Sup Forums

I'll start:

int main()
{

return 0;
}

return 0;
}

Delete system32

nailed it

plebs, return 0; is not even neccessary.

I love you guys

while(true) printf("OP is a faggot\n");

In that case, shouldn't the main method be void ?

That just hurts

cout

Hell: printf("Fuckit");
Goto Hell;

return 0;
}

extern int library_call() {
printf("hello world\n");

cout > lifePoints ;

Now one on Python

cout > lifePoints ;

if (lifePoints < 1)
{
suicide = true;
}

//Reminding Sup Forums users of their obsolete language
alert('Why are you not using .js? Get with the time grandpa!');

Goto "Tag1";

fpbp

perl -e 'print "op is a faggot\n"'

faggot

import brackets

Boy, meme magic is strong in this thread

Compilers (at least the most common ones) atuomatically insert the return 0; but yeah, void main would also do the trick

using namespace std;

return 0

Nothing you guys write will matter untill you write "tag1" and cancel this faggot's goto

just use for(;;) and skip the while(true)

// Should we write this in pseudo code first?

while op is faggot:
println('OP is a faggot')

no headers

goodlck

insert javascript

This is C++ not C

#include

int main()
{
std::string name;
std::cout

Is there a practical difference between the two? If not I prefer while(true) for readability's sake

println... Python. Clearly a java programmer that doesn't know Python

That depends on the compiler. Theoretically they could be optimized to be the same thing.

you caught me... I've been working on a java project the past few weeks and I'm still new to python. I'm probably a stupid asshole too ;)

using namespace std;

don't waste your time putting in std:: everywhere

Check 'em

Nobody cares

Well done boys. How about we contribute to a brandnew piece of software and actually help humamity to progress instead?

I know but its like a habit of mine

/*

That would cause an infinite loop

However you should put your using declaration inside of the main function in case you cause a name collision in the future.

def println( out ):
print( out + '\n' )
return

I think that's the point.

and that's why significant whitespace sucks balls

This is still a naive aproach. Print already does a newline and also you don't have to return. You could simply:

println = print

container.AddFacility().Register
(
Component.For()
.AsWcfClient(new DefaultClientModel
{
Endpoint = WcfEndpoint.BoundTo(new BasicHttpBinding()).At("localhost/IGay4chan.WebService/IGay4chan.svc")
}),
Component.For()
.AsWcfClient(new DefaultClientModel
{
Endpoint = WcfEndpoint.BoundTo(new BasicHttpBinding()).At("localhost/IFurryGuy.WebService/IFurryGuy.svc")
})
);

int main()
{
string name;
cout

01001111 01010000 00100000 01101001 01110011 00100000 01100001 00100000 01100110 01100001 01100111 01100111 01101111 01110100

Lol i feel so smart.

*/

you honestly think these faggots can anything more than hello world?

I was naive, i admit

01100111 01100110 01111001 01110011 00100000 00111011 00101001

#include
#include

using namespace std;

int main (){
char postNumber[9];
cin>>postNumber;
if (postNumber[8]==postNumber[7])
cout

out = 'rim me'
def thatsthejoke ( out ):
i = 0
while i < len( out ):
print out[i] + ' '
i += 1

both work in C and C++

Wouldn't the missing return 0 cause a compiler warning which if the program is being compiled to treat warnings as errors would make the return 0 necessary?

^^

Also:
#include
#include
#include

using namespace std;

int main()
{
string string1;
string string2;
int rot;

while (true)
{
string2 = "";

cout > string1;
cout > rot;

char c[30];

for (int i = 0; i < string1.length(); i++)
{
if (string1.at(i) + rot > 90)
{
c[i] = string1.at(i) + rot - 26;
}
else if (string1.at(i) + rot < 65)
{
c[i] = string1.at(i) + rot + 26;
}
else
{
c[i] = string1.at(i) + rot;
}

string2 += c[i];
}

cout

>println
>python
get out

But they both have different styles and best-practices.

then argue the other guy for using printf and not cout

as for speed and size I have no clue which one is actually better I just prefer using "dumb" for-loops when it's things that should just be spammed.

#include
using namespace std;
void main()
{
int num1, num2;
unsigned long long fact = 1;
cout > num1;
for(num2=num1; num2>=1; num2--)
fact*=num2;
cout

Grosss a goto when a while loop is an option. What is this? a .bat

You gotta be a faggot

if (No. == 723825555)
{
post == true;
}

you'd have to query the javascript quote, otherwise you're using an undefined variable

>>post == true;

Error: unexpected "==" in expression, coder must be a faggot

if you explicitly define a return value of int, you better fucking return something xD

//Try this fun program to get a laugh

#include

int main(void)
{
while(1){ fork(); }
return 0;
}

worked 5 minutes on this perl:

perl -MMIME::Base64 -e "do{print decode_base64(((split(qq(=)=>qq('=please_execute _me=b3AgaXMgYSBmYWc=ebYYSBmWcf=BYSBmmYcr=DgtYeYSBmc=')))[@ARGV]).qq(=)).qq( ===== )} foreach (@1000 .. 1000)" 2

Just tried it using GCC 4.9.2:
int main() { } is working flawlessly (even if checking for standard main conformity).

void main() { } produces an error (main not standard conform)

g++ -Wextra -pdeantic -w -Wfatal-errors -Wmain main.cpp

puts you're a cock

>inb4 deletes sys32

na just creates a load of processes

It's a fork bomb faggot.

int numberOfReasonsToLive()
{
return 0;
}

perl -MMIME::Base64 -e "do{print decode_base64(((split(qq(=)=>qq(''=please_execute _me=b3AgaXMgYSBmYWc=ebYYSBmWcf=BYSBmmYcr=DgtYeYSBmc='''''''')))[@ARGV]).qq(=)).qq( = ) x 10} foreach (@1000 .. 1000)" 2

i like this

Aren't you special.

Void main is not standard c++, and you shouldn't use it. Some compilers will allow it but most won't

You can do
#define EVER ;;
And have for(EVER)

;INITIALIZING
on *:connect:{
join #Tori
rlevel 1000
rlevel 500
rlevel 250
rlevel 100
}

;BAN CHECKER
on gb:JOIN:#:{ mode $chan +b $nick | kick $chan $nick Globale ban }
on cb:JOIN:#:{
if ($chan isin $ulist($address($nick,5),cb,1).info) {
mode $chan +b $nick
kick $chan $nick Geband op dit kanaal
}
}

;OPPING/VOICING
on *:JOIN:#:{
if ($nick != $me) {
if ($readini(channels.ini,$chan,auto-voice) == on) { mode $chan +v $nick }
if ($readini(channels.ini,$chan,auto-op) == on) { mode $chan +o $nick }
if (*o* iswm $readini(channels.ini,$chan,$nick)) { mode $chan +o $nick }
elseif (*v* iswm $readini(channels.ini,$chan,$nick)) { mode $chan +v $nick }
if ($readini(channels.ini,$chan,chan_greet)) { notice $nick $readini(channels.ini,$chan,chan_greet) }
if ($readini(channels.ini,$chan,count) == on) {
if ($readini(channels.ini,tellers,$chan) != $null) {
writeini channels.ini tellers $chan [ $calc($readini(channels.ini,tellers,$chan) + 1) ]
}
else { writeini channels.ini tellers $chan 1 }
msg $chan 10 $+ $nick welkom Je bent persoon nr.4 $readini(channels.ini,tellers,$chan) 10die $chan komt bezoeken het is nu01 [4 $asctime(HH:nn) 01]
}
}
if ($readini(channels.ini,$chan,chan_limit)) { timer_limit 1 5 mode $chan +l $calc($nick($chan,0,a) + $readini(channels.ini,$chan,chan_limit)) }
if ($readini(channels.ini,$chan,peak) == on) {
_peak.check $chan
}
}

I tried it in VS2015 and it didn't produce any warnings for int main() { } either so I guess it's fine. I saw the following is part of the C++ standard:

A return statement in main has the effect of leaving the main function (destroying any objects with automatic storage duration) and calling exit with the return value as the argument. If control reaches the end of main without encountering a return statement, the effect is that of executing return 0;

This behavior seems to ONLY work for the main method, because if you make another method:

int test() { }

Then that method gives you an error about how it must return a value.

that's for the kernel to worry about, program will compile and execute just fine

Yay. Finally I was correct at something.

So int main() { } is completely valid.

What surprised me though is, that for main to be conform you don't have to use main(int argc, char *argv[])

__asm hlt

I like the way you think

switch (registerSet[Registers::RepetitionMode].value)
{
case RepetitionModes::NotZero: {
do {
instructionSet[opcode]->execute(destination, source, registerSet, ram, operand1DataSize);
registerSet[Registers::CX].value -= 1;
} while (registerSet[Registers::CX].value == 0);

registerSet[Registers::RepetitionMode].value = RepetitionModes::Off;
break;
}
case RepetitionModes::Zero: {
do {
instructionSet[opcode]->execute(destination, source, registerSet, ram, operand1DataSize);
registerSet[Registers::CX].value -= 1;
} while (registerSet[Registers::CX].value != 0);

registerSet[Registers::RepetitionMode].value = RepetitionModes::Off;
}
break;
case RepetitionModes::Off: {
instructionSet[opcode]->execute(destination, source, registerSet, ram, operand1DataSize);
break;
}
}

// IMPORTANT: Adafruit_TFTLCD LIBRARY MUST BE SPECIFICALLY
// CONFIGURED FOR EITHER THE TFT SHIELD OR THE BREAKOUT BOARD.
// SEE RELEVANT COMMENTS IN Adafruit_TFTLCD.h FOR SETUP.

// Modified for SPFD5408 Library by Joao Lopes
// and touch instead serial !!!!
// Too much modifications, so not: begins e ends
// Version 0.9.2 - Rotation for Mega and screen initial

#include // Core graphics library
#include // Hardware-specific library
#include // Touch library

// The control pins for the LCD can be assigned to any digital or
// analog pins...but we'll use the analog pins as this allows us to
// double up the pins with the touch screen (see the TFT paint example).
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0

#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin

// When using the BREAKOUT BOARD only, use these 8 data lines to the LCD:
// For the Arduino Uno, Duemilanove, Diecimila, etc.:
// D0 connects to digital pin 8 (Notice these are
// D1 connects to digital pin 9 NOT in order!)
// D2 connects to digital pin 2
// D3 connects to digital pin 3
// D4 connects to digital pin 4
// D5 connects to digital pin 5
// D6 connects to digital pin 6
// D7 connects to digital pin 7
// For the Arduino Mega, use digital pins 22 through 29
// (on the 2-row header at the end of the board).

// Assign human-readable names to some common 16-bit color values:
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF

#include

#define HAND int main()
#define NIGGASCREAMS std::cout

Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
// If using the shield, all control and data lines are fixed, and
// a simpler declaration can optionally be used:
// Adafruit_TFTLCD tft;

cd code
cd..
cd..
cd..
cd..
ls
cd code
cd..

Oh god, I tried to forget about THAT thing...

int main() {
int age = 0, chics = 0;
cout age >> chics;
if (age > 17 and chics == 0) cout

forever implies it will never end though, while a loop such as that is obviously not meant to go forever in any real world application. A loop like that would typically terminate on a break or a return.