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

What can you program in C /g/?

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: 51
Thread images: 6

File: IMG_0222.png (92KB, 609x282px) Image search: [Google]
IMG_0222.png
92KB, 609x282px
What can you program in C /g/?
>>
Programs that do math. Also additional features to unix utilities.
>>
DLL files
>>
hello world
>>
File: 1452127171215.png (8KB, 398x293px) Image search: [Google]
1452127171215.png
8KB, 398x293px
>>57628501
Fuck C and use Rust.
>>
OP here. Is C even worth learning? Not from the perspective of being employed, but making certain software.
>>
>>57628602
It's useful only if you use Unix. If you use Windows or Mac OS X, don't learn C.
That said, I use Unix and love C.
>>
>>57628602
Or hobby I guess.
>>
File: 1453215010034.jpg (66KB, 500x545px) Image search: [Google]
1453215010034.jpg
66KB, 500x545px
Been using it for hobby shit for more than 15 years now. I rate it as my favourite language but I'm not sure if that's just because it's simply the one I know so well and it's effectively holding me hosting.

>tfw programming Stockholm syndrome
>>
>>57628678
Are you me?
I've been using it for 17 years and I consider it my favorite despite how tedious it is to get anything useful done in it. I only like it because I know it so well.
>>
>>57628814
Are most computer viruses programmed in C?
>>
>>57628678
>hosting
Meant hostage DAMMIT. Too tired for this shit.

>>57628814
Tedious indeed. It does give me a raging nerd boner, though.
>>
C isn't tedious. Unix userland source code isn't hard to read at all.
>>
>>57628917
I'm hard when I read it though
>>
>>57628874
so inconsequential but struct packing gets me hard as diamonds
>>
>>57628501
Your mom.
>>
>>57629718
Joke's on you, my mum already died in her sleep.
>>
>>57629718
Enjoy the (you)
>>
>>57628570
You can use both in the same time.
>>
>>57629718
Here, I made it standards compliant and not shit for you.

#include <stdio.h>

int main(void) {
puts("You suck at C");
}
>>
What can the intermediate learner do in C?

The language is really useful but if you ask why it's always about writing drivers and operating systems.

What did you guys do when you were beyond beginner stage but were still learning?
>>
>>57629852
>not including return 0
>>
>>57629855
Userland and games.
>>
File: 1463436398421.jpg (43KB, 599x444px) Image search: [Google]
1463436398421.jpg
43KB, 599x444px
>>57628501
A bunch of useless CLI programs that I don't even use anymore because it's easier to develop and maintain such programs in Python or C#.

But then again, I get fascinated with C/C++ because of all the possibilities and the things you can make with it, but I probably will never realize I can't do shit with it, at least nothing useful I think.

Autism sucks!
>>
File: fixdcode.png (15KB, 429x397px) Image search: [Google]
fixdcode.png
15KB, 429x397px
>>
>>57629882
What did you use for userland? I know there's SDL for games and I might give that a look, but do you have any other recommendations?
>>
>>57629874
>reaching the } that terminates the main function returns a value of 0.

Literally every C standard specifies this, you troglodyte.
>>
>>57629909
clang or gcc. C is only useful for Unix, do not use it on Windows or Mac OS X.
>>57629968
Doesn't your compiler warn against it?
>>
>>57630010
Where a return statement is the last statement in the main function and the return value has a constant value of 0, a compiler would have to be braindead to warn against it.
>>
>>57629889
Fix your fucking indentation, pleb
>>
>>57630044
No, it's important to warn because the result is different between C89 and C99.
>>
>>57630065
C89 is fucking horrible. In the civilised world we pretend it never existed.
>>
>>57629889
I am so mad at this.
>>
>>57629889
What is that, templeOS?
>>
>>57628501
Software.
Though I'd rather use C++ or something else to be honest.

Just as long as shit as this just werks:
switch(bla) {
a:
doA();
goto wellwell;
b:
doB();
goto wellwell;
//...

wellwell:
doStuff();
break;

default:
notWell();
break;
}
>>
Writing linked lists in c gets me hard
>>
>>57630901
>linked lists
triggered

Most C programmers are full of shit. Whenever I search for small C libraries they either contain linked lists or simple pointers + size, where pointers + size + capacity would have been appropriate.

Crippled API by global state is also a common one.
>>
>>57628602
Short answer to your question is yes.

Long answer is that the only worthwhile programmers know C and know it well. The rest are just shitty codebabies who can't program without handholding.
>>
>>57630901
nigga u wot?
>>
>>57628501
I did a bunch of multithreading, multi processor, networked and filesystem type shit for university. I've also done some math stuff, monte-carlo methods and the likes in it for fun.

I enjoy programming in C, its fun and doesn't hold your hand as much as other languages. I would rather program in C than in Python because some pythonic things trigger the shit out of me (loops and conditionals not requiring parenthesis and using colons instead of curly brackets annoys the shit out of me) however due to deadlines and writing in C is often pretty inefficient for most of work tasks.
>>
I've been doing a server that holds a table that several concurrent clients can edit over network for a university project
>>
>>57628501

>tfw having data structures paper tomorrow
>language being used is C
>written paper, suppose to be able to see code output and write code on paper

Any tips guys? Some of the questions are tricky, like how to reverse an entire linkedlist and stuff like that. I mean that isn't hard but it takes time for a pleb mind like me to think.
>>
>>57631060
lrn2 build a stack out of queries and a query out of stacks
>>
File: fbos.webm (135KB, 720x420px) Image search: [Google]
fbos.webm
135KB, 720x420px
>>57628501
C is known for fizzbuzz, operating systems, and, occasionally, fizzbuzz operating systems.
>>
>>57628501
Everything.
Except templates.
C++ can do everything.
>>
>>57631375
Kill me and then yourself
>>
>>57631060
>reverse an entire linkedlist
Assuming it's a doubly linked list,
simply start at the head and walk through until you reach the end.
For every node swap the next and previous pointer.

>Any tips guys?
As general advice, think of the problem algorithmically first (in an abstract way). And after you've understood both the problem and the solution completely, think about how to translate it into C.
>>
I programmed a little JSON parser in C++, but the code is easily portable to C.
>>
>>57632667
k
>>
>>57632620

Yeah thinking in an abstract way helps, problem is I'm a slow thinker and I would rather walk about the hallways thinking of a solution rather than having to sit down for a 2 hours paper. Fuckkkk why am i so dumb.

Also my case was a single linked list so even though I got a solution it took me quite long to think about it.

I wonder if it's normal to leave empty questions ..
>>
>>57632667
Kudos, that sounds like a nightmare. Then again, parsers were never really my thing.
Thread posts: 51
Thread images: 6


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