[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 285 KB, 1600x900, Cpic.png [View same] [iqdb] [saucenao] [google]
6990870 No.6990870 [Reply] [Original]

Alright guys, i'm calling upon all the programmers of /sci/. I've learned most of the basics of C now, except for string functions, and pointers are still a little shaky. Can anyone give me some insight on how to hone/better my knowledge of C? I'd like to really know what i'm doing with it before trying out a new language.. Any advice would be appreciated, and no i'm not a robot

>> No.6990892

It's not about knowing the language, learn algorithmics. eg, read the Cormen

>> No.6990894
File: 305 KB, 1920x1080, gprogchallenge.png [View same] [iqdb] [saucenao] [google]
6990894

>>6990870

You can't really learn programming by systematically studying concepts. You have to experience them and use them as tools to solve problems that you encounter.

Roll for a task. Start with some of the simpler mathematical ones but beware - this list contains some seriously difficult challenges.

>> No.6990896

redis has nice source code in c, so you can check how to organize your code and whatnot:

https://github.com/antirez/redis

also check Ben Klemens "21st century C" for tools pracitices etc

>> No.6990907

>>6990894
>this

it's not a race, you're supposed to enjoy it

>> No.6990923

>>6990894
Alright after looking at some of these, it seems like it'd be pretty dam difficult to do in C. Like.. How the hell would I even go about making a game of tetris?

>> No.6990925

>>6990870
https://projecteuler.net/

>> No.6990926

>>6990923
turn based with ascii output

>> No.6990928

>>6990907
That's not even what he's saying.

>>6990870
Just experiment. There's no single thing anyone can tell you that will make you understand a language, it's just a matter of using whatever features you're having trouble with until you build an intuition about how they work.

>> No.6990935

>>6990925
looks pretty interesting, i'll check it out.

>>6990926
interesting.. I feel like it would still be difficult for ME though. Might try it soon.

>>6990928
well this does seem like pretty sound advice, I guess i've just kinda been like "what should I do now?"

>> No.6990945

>>6990870
If you're only interested in the coding part: >>6990894, post in the DPT on /g/ and remember that all beginner questions have been asked on StackOverflow. The rest will come. (note: learn your pointers well, it's easy to make mistakes with them but they are often damn useful, it's a shame higher level languages don't have them)
If you're interested in it from a computer science point of view: >>6990892, >>6990925

You can try competitive programming too. E.g. usaco (bronze is beginner level, silver is "at least I know the language" level, gold is a bit advanced), coci (most of the problems are quite easy in my opinion), codeforces (difficulty varies from problem to problem), topcoder (generally harder than codeforces), UVa online judge. There are many others out there, these are the ones that first come to my mind. I suggest starting by doing old assignments in your own time and when you feel a bit more confident start participating in some competition. (If you choose to follow this way, a personal suggestion: use procedural C++, this way you can use stl)

>> No.6990951
File: 39 KB, 547x723, tetris.png [View same] [iqdb] [saucenao] [google]
6990951

>>6990923

Avoid the heavily graphical ones because C is not a language for graphical applications. Your best bet would be to move to C++ and use a library like allegro but If you're a beginner I'd recommend a good 6 months of projects before trying something so difficult.

I made tetris when I was moving from swing to FX in Java a couple of months ago.

>> No.6990956

>>6990951
But OpenGL has a C interface.

>> No.6990965

>>6990956

OOP makes graphics simpler to do. I'm not saying its impossible - I'm saying programmatic toolsets have been developed that are designed to facilitate such a project. C would not be the choice amongst programmers because as a tool its better suited for other things.

>> No.6990968

>>6990894
>flappy bird
aint nobody got time for that

>> No.6990977

>>6990968

it's a simple graphical game, perfect for learning

>> No.6990978

>>6990965
>muh OOP

OP is asking about C and you're telling him to use C++. Might as well just recommend Python if you're not sticking to the question.

>> No.6990981

>>6990978

OP asked about doing graphics in C and I told him the truth.

>> No.6990985

I suppose I could just look back over the book i used at uni this last semester that covers C, and it should help me solidify pointers and give me some insight on string.h

>> No.6991037

>>6990894
Roll for fun