C is a general-purpose programming language used for system programming (OS and embedded), libraries, games and cross-platform. This tag should be used with general questions concerning the C language, as defined in the ISO 9899 standard (the latest version, 9899:2018, unless otherwise specified — also tag version-specific requests with c89, c99, c11, etc). C is distinct from C++ and it should not be combined with the C++ tag absent a rational reason.
381,080 questions 2- Bountied 2
- Unanswered
- Frequent
- Score
- Unanswered (my tags)
What are the differences between sem and pthread_cond in C
Hello I start with pthread_cond and semaphore in C and I see semaphore have this services: int sem_init(sem_t *sem, int shared, int valini); int sem_destroy(sem_t *sem); int sem_wait(sem_t *sem); int ... c- 1
Is there any Equivalent to this c code in assembly language x86
Is there any Equivalent to this C Code in the Assembly language x86? Probably, Yes but I don't know. Here's the C Code #define lol 0x00004000 #define something 0x00000100 void main(void) { ... c assembly- 13
Suppressing "variable set but not used" warnings in the disabled case of a debug printf macro
There are a ton of questions about suppressing "variable set but not used" warnings, but I haven't found one that addresses my very specific problem, which is a debugging macro defined as ... c- 129k
Linked List nodes disappear while adding (nodes showing garbage values)
I need to read a set of data from a text file and add them as nodes to a linked list. The linked list needs to be an ordered list according to studentID present in the data. I did the following code. ... c structure- 1
How to code function if nothing, or wrong input is entered to ask aqain for input + what is wrong. It is possible everything split in functions?
#include <stdlib.h> #include <stdio.h> char input(char emailInput[100]) { printf("Enter email:"); // if nothing or wrong email is input repeat// gets(... c function validation email input- 1
Recursive function for converting lower case to upper case
I've been tasked to write a recursive function in C that changes a string of any chars to all caps (without using toupper() or any other function for that matter). This is the previous code and ... c string recursion- 11
When to use calloc or malloc in C [duplicate]
What's better/more efficient - calloc or malloc? I want to initialise structs, that refer to other instances of the same struct also VARIANT 1 person *new_person() { struct _person *person = ... c struct malloc calloc- 101
using C copy a 1D char array into 2D char array
I am trying to copy a 1D array of Strings into a 2D array of strings in C. I was able to achieve this with integer enter image description here //Here is what I tried for integers. int main() ... arrays c gcc multidimensional-array c-strings- 31
What will be the output of a fork() in a for loop
int main() { pid_t pid; int i; printf("START\n"); for (i=0; i<6; i++){ if ((pid = fork()) <0){fprintf(stderr, "Fork failed\n"); return 1;} printf("A\n"); ... c fork posix- 1
NOOB Q - # include <stdio.h) in VScode [duplicate]
Recently started learning to code and for my very first program in C I am Getting this error and don't know how to fix it: cannot open source file "stdio.h" code : #include <stdio.h> ... c visual-c++- 1
Why are asterisks needed for array variable?
Looking at the code segment down below, array in C language is already a pointer saving the address of the first element of the array, so why the asterisk is needed for argv variable? char *argv[3]; ... arrays c pointers declaration- 11
Calling C function from Kotlin using JNI
I have created two C functions with the following declarations: /* Function Declarations */ extern void compute_feature_set(double input[1102], double F_data[], int ... c kotlin java-native-interface- 261
C memory leak, where there is no memory leak? (valgrind)
valgrind is telling me that a specific line in my code creates a memory leak, but when looking at that line, it does not seem to even be able to create one. I am working with this pretty simple Linked ... c memory-leaks- 31
why the return has no output of counting function in C? [closed]
I need to create a function that return the number of characters given . but there is no output. (ps: i cant use printf for study issues) #include <stdio.h> int ft_strlen(char *str) { int i =... c return output- 1
function that returns a version of the given arrays where each zero value in the array is replaced by the smallest odd value to the right of 0. In C
I'm having a bit of trouble with this problem. The full text of the problem is as follows : "Write a function that returns a version of the given array of non-negative integers where each zero ... arrays c function loops pointers- 3
15 30 50 per page12345…25406 Next