I'm building GCC 8.5.0 on a Devuan Chimaera GNU/Linux system (using GCC 10). I've configured with ./configure --disable-gnat, then ran make. At some point, I ge
C2x, 6.5.3.2 Address and indirection operators, Constraints, 2: The operand of the unary * operator shall have pointer type. Why there is no constraint "the o
C11, 6.7.2.1 Structure and union specifiers, Constraints, 3 (emphasis added): A structure or union shall not contain a member with incomplete or function type
We know there exists #pragma once which prevents source file to be included more than once, but how to make preprocessor (with conditional compilation) which pr
The following output seems to suggest that when read () is called after a getchar() it clears all the stdin. Let's say that I typed "Hello\n" : char buff; int c
I am trying to run an example program from the wiringPi in C++ in Geany software(called blink.cpp) This is the code (I did not do it, I took it directly from t
I have declared a 2D malloc array like this in C: int** pArray; int i; pArray=(int**)malloc(pRows*sizeof(int*)); for(i=0;i<pRows;i++)
#include<stdio.h> #include<stdlib.h> void insert_front(struct node* head, int block_number); void insert_rear(struct node* head,
char buff[1]; int main() { int c; c = getchar(); printf("%d\n", c); //output -1 c = getchar(); printf("%d\n", c); // output -1 int re
I am trying to get a number and a repetition number then adding as many numbers as the number of repetition one after the other. But I am getting 3221225477 res
Good Morning, I'm having an issue with some C code where I am forced to hit enter twice each time input is entered if the length of the input is less than the s
I am testing a C++ program for problems. I am running it under valgrind. I start the program with // valgrind test char * p = (char*)malloc(4);
I want to write a C file + get correct diagnostics and tree-sitter syntax highlighting in neovim. Everything works fine, unless I include an external library (i
I'm attempting to do basic file reading in C with fgets. It should read one line, pass it to the tokeniser function which should split it at every ' ' and add
My box runs Ubuntu 21.10. I use GTK4, C-language and XML description of the GUI. I am new to GUIs in general, and to GTK4 in particular. The program uses a GtkF
For my studies, I have to write a C function GetEvenNumber: parameters: array with n integers + array size; returns tr array which contains even integers from t
I have a simple file reading algorithm but it's not returning the values that are in the file. The below is the code. The input txt values are 200 53 65 98 183
Project structure: enter image description here When starting the makefile, I get an error: src/main.c:1:10: fatal error: lib/hello.h: No such file or directory
why there is no "*" in output? the input is : abcde[enter key] #include<stdio.h> int main(void){ char ch; while ((ch=getchar( ))== 'e') pr
The question is pretty much in the title. The code void modify_str(char* str){ if(strlen(str) > 5) { str[5] = 'x'; } } Will invoke undef