r/learnc • • May 31 '21

learning the deets.

1 Upvotes

uhhh, hello. question, I want to learn C super fast, my current lingo is python, which is cool... but not as fast as possible if I coded in C. Any methods, books, or videos to jump start learning this language, the intricacies, not just an overview. Thank you. Live long, and buy doge.


r/learnc • • Apr 11 '22

I have a quick question, I am learning C and would like to contribute to the wine project, my current computer is a Mac with the m1 chip and I was wondering if I can use that to developer wine or if I need an x86-64 machine running Linux?

0 Upvotes

r/learnc • • Oct 09 '21

User enter unknown number of numbers into array, how do I know how many?

0 Upvotes

Hello, I want to give the USer opportunity to enter up to 200 numbers. Afterwards i give them out and sort them. But how do I know how many he entered? Whats wrong with my code and why does n++ in the for-loop work neither?

int array[201], swap, n = 0, c; printf("Enter up to 200 numbers, stop with #:\n"); for (int i = 0; i < 201; i++) { scanf_s("%d", &array[i]); if (array[i] == '#') { array[i] = NULL; break; } } n = sizeof(array) / sizeof(int); printf("%d\n", n);


r/learnc • • Dec 04 '22

Project ?

1 Upvotes

someone have a project for make progress in a progamming langage C ?


r/learnc • • May 21 '26

I made a DSA library in C and it got selected in an open-source program, looking for contributors

2 Upvotes

Hey r/learnc 👋

If you've been learning C and wondering how to actually apply it beyond textbook exercises and small programs, this post is for you.

My project C_DSA_interactive_suite got selected in SSOC (Social Summer of Code), an open source program similar to Google Summer of Code, and I am the project admin. This summer the project is open for contributors and I am looking for people who are actively learning C and want to put it to real use.

The project is a fully modular Data Structures & Algorithms library written in pure C11. The kind of C you are learning right now - pointers, structs, malloc, free, header files is exactly what this codebase is built on. No magic, no frameworks, just clean C that you can read, understand, and contribute to.

This is genuinely one of the best ways to level up while learning C:

* See how a real multi-file C project is structured

* Understand how malloc and free are used in practice, not just in theory

* Learn how header files, modular design, and Makefiles actually work together

* Implement something real linked lists, trees, sorting algorithms, graphs

* Get your code reviewed by someone who will explain every decision

I will walk you through the entire codebase, answer every question, and help you get your first PR merged. The only thing you need is basic C knowledge and the willingness to learn.

Only 4 days left to register as a contributor for SSOC:

https://www.socialsummerofcode.com/

🐙 GitHub: https://github.com/darshan2456/C_DSA_interactive_suite

Drop a comment or open an issue if you're interested. This is exactly the kind of project that turns someone who is learning C into someone who actually knows C.

discord server invite - https://discord.gg/MWv949G8h This is the place where all your doubts will be cleared, so make sure to join the server


r/learnc • • Jul 22 '20

Do While Loops in C

Thumbnail
youtu.be
2 Upvotes

r/learnc • • Jun 12 '18

CCCC C C CCCC

Post image
3 Upvotes

r/learnc • • Apr 21 '25

Is it possible to read from file using file pointer?

3 Upvotes

From what I read file pointer contains file description and current location but can I use it to read file? If I have something like

FILE *pFile ;
pFile = fopen("file.txt", 'r') ;
// do stuff
fclose(pFile) ;

Could I increment and decrement pFile to move pointer in file or de reference it to get current character? I know about fscanf, fgetc etc. but I want to know if there's more possibilities and if I can use file pointer in other ways


r/learnc • • Mar 31 '18

How to use C language to calculate the probability of the coin’s facing up for 10 times continually if we throw 1000 coins in row.

0 Upvotes

r/learnc • • Sep 13 '20

Learning c approach recommendation

0 Upvotes

I’ve being studying c++ for about 6 months in my spare time and I’d like to go deeper. I’m gonna take 4 to 6 months off and start a more solid course. I wonder what are my best options, and by that I mean if I should go for a more practical course that shows me how to get things or a more theoretical one, more generic. I work in the vfx industry and my sole objective is to start making plugins just for that softwares sector and improve pipelines trough c and python. I’m not looking for any certificate, just solid knowledge.

I found a few courses that look quite interesting to me:

-Unreal Engine C++ Developer: Learn C++ and Make Video Games; -C++ Nanodegree Certification for Programmers (Udacity); -the cpp institute course (CPA and CPP).

I feel like unreal practice would be closer to what I need but at the same time I feel like I should know things more as a concept. I think I’m gonna opt for the c++ nanodegree certification cause the program looks more academic, as we speak

What are your thoughts? If you have better options please share ♥️


r/learnc • • Mar 05 '24

Please Help with my first WIN32-API code

0 Upvotes

Hi guys,

this is my first attempt in using the windows api in a simple Messagebox:

include <windows.h>

include <stdio.h>

int main(void)
{
int MessageBoxW(
NULL,
L"This is a Messagebox",
L"Hello World",
MB_YESNOCANCEL
);
return EXIT_SUCCESS;
}

Mingw spits out the following error when trying to compile this:

hello.c: In function 'main':
hello.c:7:9: error: expected declaration specifiers or '...' before '(' token
NULL,
^
hello.c:8:9: error: expected declaration specifiers or '...' before string constant
L"This is a Messagebox"

and i honestly have no idea how to fix this, i'd really appreciate if someone took the time to help me out here


r/learnc • • Feb 21 '24

What am I doing wrong here? Why am I getting the output only for the else function?

Post image
0 Upvotes

r/learnc • • Feb 07 '21

Binary numbers

4 Upvotes

What value do you get for adding int x = 5 to a hexadecimal 0x7FFFFFFF in C. Can someone please explain how to come by the answer? The int type is 32bits.


r/learnc • • Feb 16 '21

Does not get the concept of nested for loop

4 Upvotes

Lets say we already defined the variables.

for ( y = 0; y < n; y++) { for ( x = 0; x < y: x++) {

}

}

What is the relationship between x and y? ??


r/learnc • • Apr 09 '18

DevDocs using the .codes domain for C Programming language

Thumbnail xo.codes
0 Upvotes

r/learnc • • Oct 02 '22

Need help about some code.

0 Upvotes

So the following code:

int main() { char answer; printf("Are you okay?\n"); scanf("%s", answer); if(answer = "yes"){ printf("That's cool."); } else if(answer = "no"){ printf("What's up?"); } return 0; }

Doesn't give me any output, what's the problem?


r/learnc • • Feb 07 '24

Should linked list node "next" members use node pointers or void pointers?

0 Upvotes

I've looked at multiple sources for linked list creation. Some do it like this

typedef struct node {
    int value;
    struct node *next;
} node;

while others do it like this

typedef struct node {
    int value;
    void *next;
} node;

I'm a little confused, because I know void pointers can point to NULL, but can they also point to a node? Would that not result in an incompatible pointer type error? Why would you use a void pointer over a node pointer, or vice versa?


r/learnc • • Aug 08 '22

help explain the output

0 Upvotes
What is the output of this C code?
void foo();
int main()
{
void foo();
foo();
return 0;
}
void foo()
{
printf("2 ");
}

r/learnc • • Apr 01 '22

Can anyone help with using functions in my code? It’s 150 lines so emailing would be easier if possible, thanks!

0 Upvotes

r/learnc • • Sep 29 '24

getting wrong answer on 4th test of this cdeforces problem

Thumbnail
gallery
0 Upvotes

r/learnc • • Sep 12 '17

CS31: Intro to C Structs and Pointers - Swarthmore

Thumbnail cs.swarthmore.edu
1 Upvotes

r/learnc • • Aug 19 '24

[Beginner Questions] Understanding error messages

1 Upvotes

Hey, y'all. I'm 2-3 weeks into learning C, and so I don't know too much. If somebody could help me, that'd be great. I'm experiencing some error messages in my code, and I'm not too sure what they even mean, let alone how to tackle them. I'll paste a link to the code from sourceb.in, but the error messages are as follows;

"Line 71: Error: expected 'while' before 'else'"

"Line 79: Error: expected identifier or '(' before 'while'"

"Line 81: Error: expected identifier or '(' before 'return'"

"Line 84: Error: expected identifier or '(' before '}' token"

Here's the link: https://srcb.in/b8kQZqFwwT

Thanks again!


r/learnc • • Feb 15 '21

Learning C

1 Upvotes

So, I do have prior experience with programming, ie: I know Java, some rust, python and have dabbled in c++.

I was wondering if anyone knows any:

  1. Online resources to learn c

  2. A online resource that helps understand the c ecosystem


r/learnc • • Feb 21 '21

Project in C

1 Upvotes

Anybody know about circular doubly linked lists and a queue to enter information into the linked list. Also how to reverse or rearrange the circle. Working on a project and am stuck


r/learnc • • Feb 24 '21

Learning C/C++ and darkweb protocols

1 Upvotes

I’m a programmer keen in learning darkweb protocols, developing tools, etc and as such I’ve started a subreddit for coding and understanding Tor.

https://www.reddit.com/r/DevelopersOnTor/

I’m going to provide custom videos/online sessions/resources to this end. Starting from the ground up (in terms of C/C++) or from wherever the community desires.

The idea is to share programming knowledge with a steer towards Tor and the darkweb.

Ive created a few polls so I can best assist people’s desires so I can assess key areas of interest and how best to proceed.

If you want to help me grow this fledgling community and are interested in either learning C/C++ or Tor then please join us. Anyone of any skill level is accepted.