C Programming | Reddit
0 FOLLOWERS
This sub-reddit is for the discussion of C programming language, related news, useful tips for beginners and ask question about anything related to the programming language.
C Programming | Reddit
21h ago
Pls I want to know some uses of pointers and how beneficial it is for a program because am a beginner and I don’t see how I can use them for myself so I find it hard understanding it, I want to know how I can use them and what it can be used for in programs
submitted by /u/Then_Hunter7272
[visit reddit] [comments ..read more
C Programming | Reddit
21h ago
Hey, I am building a library that allows you to print a progress bar. Currently, I enable the user to select a common character. However, the issue arises when I attempt to allow the user to pass Unicode characters, as the '\u' throws an error. Specifically, '\u' is being used without any following hex digits.
Here's the relevant code snippet:
printf("\x1b[38;5;%dm\u%x", pBar->color, pBar->unicode);
I appreciate any ideas or suggestions on how to resolve this. Thanks!"
submitted by /u/vaquitson
[visit reddit] [comments ..read more
C Programming | Reddit
1d ago
I'm looking for an IDE.
What I really need from an IDE:
Capable of reading in included libraries (maybe with cmake). Capable of reading headers of function (even from included libraries) and suggesting and visualising it when I write the function.
Capable of autocomplete suggestion based ONLY on variable I defined in the scope. No strange vsc stuff I need each time to dismiss with esc or die trying to use arrows to move one.
Capable of autocomplete function name based on all the possible functions defined in the libraries I included.
Capable of syncing on github. Capable of having various col ..read more
C Programming | Reddit
1d ago
I am working on an assignment and am having a horribel time trying to get my linked list to not put the one set into EVERY single node and overwrite the set in the others before it.
submitted by /u/Extension-Pickle5421
[visit reddit] [comments ..read more
C Programming | Reddit
1d ago
My c programming exam in on a online platform, there is a compiler, I want to find all hidden test cases for that question so that i print expected output.
submitted by /u/pussykiller486
[visit reddit] [comments ..read more
C Programming | Reddit
1d ago
can someone help me find some good c pointer to functions exercises with solutions? so i can better grasp them.
thank you.
edit:
other than qsort on k&r or man pages, thank you
submitted by /u/Active_Ad_3448
[visit reddit] [comments ..read more
C Programming | Reddit
1d ago
I'm doing some review problems for my next test and I'm trying to store some ints from a file to an int array but a random 7 digit value is getting stored in all the array slots when I print it out. I've tried looking for a fix but can't find any results online.
#include <stdlib.h> int main(){ FILE *fptr; int arr[7]; fptr = fopen("numbers.txt", "r"); /*numbers.txt contains: 12 14 15 15 17 28 39*/ if(fptr == NULL){ printf("File unable to open\n"); } else{ printf("File opened\n"); } int i = 0; int j = 0; while(!feof(fptr)){ fscanf(fptr, "%d ", &i); arr[j] = i; j++; } for(int k = 0; k ..read more
C Programming | Reddit
1d ago
Short version:
I am looking for a site or book where I can find novice to expert level practice programs specifically for C (not c++, not c#, just c) that also has solutions (possibly multiple) to those problems.
Long Version:
I'm in my 30s so I already feel out of place in college but I have a great desire to have the ability to be sole provider for my wife and future children. Right now I am going to school for Computer Engineering using the G.I. Bill which pays a monthly allowance supplementing my wifes income. If she were the sole provider we could survive on a tight budget so the G.I. Bi ..read more
C Programming | Reddit
2d ago
static const int enumerationCounter[] = { #include "someHeader.h" }; //someHeader.h consists of an enumeration
Then use sizeof enumerationCounter / sizeof int to get the number of entries in the enumeration.
submitted by /u/KillingForCompany
[visit reddit] [comments ..read more
C Programming | Reddit
2d ago
How come this works:
Char name[20] = "Mary";
But this doesn't.
Char name[20];
Name[20] = "Mary";
Am I correct in that the above fails because I'm telling it to put "Mary" in the name[20] element? Is that how it's interpreted?
Is there a way to initialize char name[20] array separately from the declaration without using srtcpy()? Just wondering
Thanks
submitted by /u/apooroldinvestor
[visit reddit] [comments ..read more