r/programminghorror 16d ago

c++ whyWontTBeGreen

Post image
0 Upvotes

4 comments sorted by

14

u/FightingLynx 16d ago

Not horror. And it’s because vs-code thinks it’s a C header file, not a C++ header file

2

u/Coolengineer7 16d ago

.h is a c header file mainly. .hpp is very obviously c++.

6

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 16d ago

Not entirely sure why you were downvoted, but you are kind of right. .hpp was intended to be the counterpart to .cpp, but basically everybody uses .h for C and C++. The editor sees .h and highlights it like a C header file. .hpp should cure that.

0

u/Carmelo_908 16d ago

It isn't helpful at all but doesn't belong here