[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]

There is nothing wrong with making a string in c like this.

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 11
Thread images: 2

File: images.jpg (8KB, 230x219px) Image search: [Google]
images.jpg
8KB, 230x219px
There is nothing wrong with making a string in c like this.

typedef char[100] string;
>>
What if you need a string big enough to hold your mom's weight?
>>
>>56360484
Then it would need to be dynamically allocated
>>
>>56360382
Well, except for the syntax error of course
>>
>>56360382
test_typedef.c:13:16: error: expected identifier or ‘(’ before ‘[’ token
typedef char [100] string;

gcc thinks otherwise.
>>
File: 1472481968579.png (184KB, 500x500px) Image search: [Google]
1472481968579.png
184KB, 500x500px
>>56360382
What the fuck is that?
>>
>>56360659
>>56360889
Well maybe i typed it wrong but you know what i mean.
>>
>>56361345
Do we?
>>
>>56360382
But why?
>>
>>56361397
const int STRING_SIZE = 10; typedef char string[STRING_SIZE];
>>
>>56360382
There is everything wrong when working with strings in C. It is so fucking easy to make a fail when working with strings in C.
Substring, length, concentation, startswith, endswith, god sake split or regex, toLower, toUpper, trim, read unknown length of text from user. Just sucks. Or when trying to parse date, number or something else. Pure cancer.

So fucking bad. And oh god, the functions names, if you are so lucky and doesn't need to re-implement wheel for the 99th time again, good luck understanding the cryptic name of arguments and then it shits itself when porting to "just works" Windows, which have same functions, but slightly more fucked up names.
Thread posts: 11
Thread images: 2


[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.