It's time to answer the final question
*.h or *.hpp
?
>>35067052
h and hpp are the plebian choices, there are also hxx and h++.
>>35067052
>he doesn't realize they are for separating C and C++ header files
Use .hpp for C++ and .h for C to maintain clear and consistent code.
>>35067134
OP is probably someone who claims to do "C/C++" on his resume, as if this were a thing.
>>35067052
It's time to answer the final question
std::size_t or char
?
>>35067374
unsigned char if you find yourself writing "some_size_t % 256" often.
>>35067374
It's time to answer the final question
std::vector<std::array<std::uint8_t, sizeof(float)>> accessed using *reinterpret_cast<float*>(vec[i].data())
or
std::vector<float> accessed using vec[i]
fuck the police I use *.h
>>35067531
The latter because it's shorter and clearer and you know what you're doing (e.g. don't try to read/write outside the array).
To be honest, I haven't coded for years and programmong was the only thing I didn't completely suck at, and now I probably can't even do that.
function(){
...
}
or
function()
{
...
}
I've had a lecture mention he would mark people down for using the latter becaue it was "just not java"
Implying it fine to do in other languages but not java.
Was it autism?
>>35068592
I used to prefer K&R style but now my monitor is so huge that I just go Allman
I always spaced my functions as the the second one though
>>35068592
I did the latter because I had a thing for symmetry even though logically it makes more sense real estate wise to conduct the former. I write my code like I'm writing a book though. Nasty habit.