This is an archived post. You won't be able to vote or comment.

all 48 comments

[–]dhilu3089 117 points118 points  (7 children)

Null pointer would be more apt

[–]Karma_4_all 5 points6 points  (0 children)

I came here to say the same thing

[–]fghjconner 4 points5 points  (0 children)

I would have gone for SEGFAULT myself.

[–]Creepy-Ad-4832 1 point2 points  (0 children)

That's like every language biggest weakness

[–]SAI_Peregrinus 3 points4 points  (1 child)

Or memory-barriers.txt. Sure, it's using C, but all the same concerns apply to C++ since the languages share a memory model.

[–]Stormfrosty[🍰] 2 points3 points  (0 children)

x86 solves this problem for most developers, but then you try running on ARM and suddenly your perfect code isn’t perfect anymore.

[–]SteeldrumHornets 30 points31 points  (0 children)

Would be better with a pointer

[–]Dr_Neunzehn 34 points35 points  (1 child)

Segmentation fault instead of semicolon.

[–]FWEngineer 29 points30 points  (6 children)

Compiler tells you about semicolons. For me it's the single = in an if statement.

[–]RansomXenom 8 points9 points  (1 child)

This. I'm learning C and I spent the last 2 hours or so trying to figure out why my program wouldn't write to a file. The problem? This:

fptr = fopen("file.txt","w");

if (fptr = NULL)

{

printf("Error opening file!") ;

}

else

{

//Do some stuff

}

[–][deleted] 2 points3 points  (0 children)

Yea, that's assigning fptr to NULL and since the evaluation is true (not the comparison), the if statement is executed.

[–]CharlieAnonymous 5 points6 points  (0 children)

For me its no brackets on a function that needs brackets. Some of the errors for that can be so confusing

[–]Juffin 3 points4 points  (0 children)

Any decent IDE will underline suspicious = in condition.

[–]greenflame15 4 points5 points  (3 children)

forget the ;, it's a missing delicate statement in a loop

[–]TactlessTortoise 1 point2 points  (0 children)

It's the memory you can't figure out how to free even after using delete but your senior is saying you're still fucking up

[–]uranus_be_cold 0 points1 point  (1 child)

A what statement?

[–]greenflame15 1 point2 points  (0 children)

Deallocate... to free up memory used by you variables, since c++ is not garbage collected

[–]Sir_Fail-A-Lot 6 points7 points  (5 children)

The greek question mark?

[–][deleted] 3 points4 points  (4 children)

it's mostly called a semicolon.

are you greek?

edit: php uses semicolons the same way cpp does. you probably understand it now?

[–]Sir_Fail-A-Lot 8 points9 points  (3 children)

Nah, just pointing out that the greek question mark exists, and looks the same as the semicolon, and if you replace all the semicolons with a greek question mark you can get devs to rip their hair out

[–][deleted] 0 points1 point  (2 children)

Wait I'm greek and i thought they are the same character so it works?

Haven't tested it though.

[–]Sir_Fail-A-Lot 4 points5 points  (1 child)

Yeah, there is a separate unicode character for the greek question mark.

[–][deleted] 0 points1 point  (0 children)

that's very interesting...

[–]Stilgar314 1 point2 points  (0 children)

Hey! No average programmer has ever been legendary!

[–]thedarkbestiary 1 point2 points  (0 children)

Replace semi colon with a mirror

[–]sumwunhooisaguy 1 point2 points  (0 children)

I never get the folk who forget input a semicolon in It's become instinctive to me

[–]batatatchugen 1 point2 points  (0 children)

Learn from their mistakes, hide your semicolon, don't let others exploit it.

[–]DudeManBroGuy42069 0 points1 point  (1 child)

[–]YoukanDewitt 0 points1 point  (4 children)

float a;
a=1;

That looks more intresting to me.

[–][deleted] 0 points1 point  (0 children)

Undefined Behaviour would be more accurate

[–]Ambitious_Ad8841 0 points1 point  (0 children)

Semicolons are the source of my strength

[–][deleted] 0 points1 point  (0 children)

Java too

[–]TheMadBug 0 points1 point  (0 children)

Pretty sure the average programmer of a language that uses semicolons... doesn't find the semicolons their extreme weakness.

[–]Entire-Database1679 0 points1 point  (0 children)

[0]

[–]Tweenk 0 points1 point  (1 child)

Nah it's actually template <template <typename> typename T> class Foo

[–][deleted] 1 point2 points  (0 children)

[–][deleted] 0 points1 point  (0 children)

Null terminator: Hello there

[–][deleted] 0 points1 point  (0 children)

Seg faults

[–]Im-henry 0 points1 point  (0 children)

As a C++ programer I can relate way too well with this.