[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

It's time to answer the final question *.h or *.hpp ?

This is a red board which means that it's strictly for adults (Not Safe For Work content only). If you see any illegal content, please report it.

Thread replies: 12
Thread images: 1

File: 1475296059479.jpg (436KB, 1280x1024px) Image search: [Google]
1475296059479.jpg
436KB, 1280x1024px
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.
Thread posts: 12
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.