Welcome to Incels.is - Involuntary Celibate Forum

Welcome! This is a forum for involuntary celibates: people who lack a significant other. Are you lonely and wish you had someone in your life? You're not alone! Join our forum and talk to people just like you.

C++

  • Thread starter DepravedAndDeprived
  • Start date
DepravedAndDeprived

DepravedAndDeprived

And then one day, for no reason at all...
★★★★★
Joined
Jun 27, 2020
Posts
7,456
#include <iostream>

int main() {
std::cout << "Fuck niggers\n";
return 0;
}
 
C:
#include <stdio.h>

void psyop();

int main() {
    psyop();
    return 0;
}

void psyop(){
    char world[10];
    printf("Did 6 million jews died in holocaust\n");
    world = getchar();
    if(world == 'yes')
        printf(" GooD GoY\n");
    else
        psyop();
}
 
output:

Did 6 million jews died in holocaust


no


Did 6 million jews died in holocaust


Did 6 million jews died in holocaust


Did 6 million jews died in holocaust


yes


GooD GoY



WHY THE FUCK THIS IS THE OUTPUT 3 TIMES!!
:reeeeee: :reeeeee: :reeeeee:
 
63723
 
WHY THE FUCK THIS IS THE OUTPUT 3 TIMES!!
because getchar() gets one char only and you typed "no" and pressed enter so it is getting 'n', 'o' and '\n'.
 
Also if(world == 'yes') doesn't mean anything I'm surprised it even compiled.
You can't compare strings like that, there's probably a function but I can't remember rn.
Also strings should be in double quotes not single quotes.

If this compiled this is probably only comparing the first element of the array world[] with the character 'y'.
 
Also if(world == 'yes') doesn't mean anything I'm surprised it even compiled.
You can't compare strings like that, there's probably a function but I can't remember rn.
Also strings should be in double quotes not single quotes.

If this compiled this is probably only comparing the first element of the array world[] with the character 'y'.
FuElVKrX0AIQBgx.jpg
 
You can't compare strings like that, there's probably a function but I can't remember rn.
In java you have . equals(something), there's probably something similar in C++
 
C:
#include <stdio.h>

void psyop();

int main() {
    psyop();
    return 0;
}

void psyop(){
    char world[10];
    printf("Did 6 million jews died in holocaust\n");
    world = getchar();
    if(world == 'yes')
        printf(" GooD GoY\n");
    else
        psyop();
}
Also I think that your function would work better if you used strings instead of chars. If you want to use chars you'd need to like do a while loop when you get an input and like memorize everything in an array of unknown length till you hit \n. Then you'd need to compare yes with the input array and that would mean a for loop.

In conclusion just use Strings.
 
WHY THE FUCK THIS IS THE OUTPUT 3 TIMES!!
You can't compare strings like that, there's probably a function but I can't remember rn.
In conclusion just use Strings.
#include <iostream>
#include <string>

int main() {
psyop();
return 0;
}

void psyop() {
std::cout << "Did 6 million Jews die in the Holocaust?\n";
std::string answer;
std::cin >> answer;
if (answer == "yes") {
std::cout << "GooD GoY\n";
} else {
psyop();
}
}

How's this niggers
 
#include <iostream>
#include <string>

int main() {
psyop();
return 0;
}

void psyop() {
std::cout << "Did 6 million Jews die in the Holocaust?\n";
std::string answer;
std::cin >> answer;
if (answer == "yes") {
std::cout << "GooD GoY\n";
} else {
psyop();
}
}

How's this niggers
Flawless code, you are better than almost all currycels
 
#include <iostream>
#include <string>

int main() {
psyop();
return 0;
}

void psyop() {
std::cout << "Did 6 million Jews die in the Holocaust?\n";
std::string answer;
std::cin >> answer;
if (answer == "yes") {
std::cout << "GooD GoY\n";
} else {
psyop();
}
}

How's this niggers
Code:
g++     psyop.cpp   -o psyop
psyop.cpp: In function ‘int main()’:
psyop.cpp:5:6: error: ‘psyop’ was not declared in this scope
    5 |      psyop();
      |      ^~~~~
make: *** [<builtin>: psyop] Error 1

won't work on my compiler
 
Code:
g++     psyop.cpp   -o psyop
psyop.cpp: In function ‘int main()’:
psyop.cpp:5:6: error: ‘psyop’ was not declared in this scope
    5 |      psyop();
      |      ^~~~~
make: *** [<builtin>: psyop] Error 1

won't work on my compiler
Brutal, put definition of psyop() above main() and it should work
 
Code:
g++     psyop.cpp   -o psyop
psyop.cpp: In function ‘int main()’:
psyop.cpp:5:6: error: ‘psyop’ was not declared in this scope
    5 |      psyop();
      |      ^~~~~
make: *** [<builtin>: psyop] Error 1

won't work on my compiler
main should be below psyop(), since psyop needs to be compiled first before it's called on main.
 
#include <iostream>
#include <string>

int main() {
psyop();
return 0;
}

void psyop() {
std::cout << "Did 6 million Jews die in the Holocaust?\n";
std::string answer;
std::cin >> answer;
if (answer == "yes") {
std::cout << "GooD GoY\n";
} else {
psyop();
}
}

How's this niggers
define the function first, because compiler is blind
 

Similar threads

Seahorsecel
Replies
3
Views
154
Seahorsecel
Seahorsecel
Lonelyus
Replies
41
Views
543
Arabcel99
Arabcel99
svgmn1
Replies
6
Views
145
svgmn1
svgmn1
AsiaCel
Replies
7
Views
180
Julaybib
Julaybib
blackpillednigga
Replies
6
Views
143
SoycuckGodOfReddit
SoycuckGodOfReddit

Users who are viewing this thread

shape1
shape2
shape3
shape4
shape5
shape6
Back
Top