I have to create a function that sum components of a vector this way: first + second, third + fourth, 5th + 6th, and so on. original vector has size "size". I h
related to Providing stdin to an emscripten HTML program? function stdin() { if (i < input.length) { var code = input.charCodeAt(i); +
I am doing all my assignments in a single .c file by writing functions, but now it seems that it affects the run time. Does it mean that if I do not call a func
I am new to programing, and I found one interesting but difficult to find reason problem, so I am writing this post. I was trying to write swap function: When I
I've the following code that I compile and run on Linux: #include <stdio.h> // can't be static void do_stuff(void) { ;; } typedef void (*func)(void)
Is it safe to use printf("%*s", len, ptr) where len is an integer and ptr is non-null terminated? If not safe, what will happen in the worst case? And then how
We have an old product that running Linux 3.14 Preempt kernel, One application keeps polling field devices one by one: send one UDP packet to one IP then sleep
I'm making a program that basically "ciphers" a text, by substituting the letters by other ones. So you basically run the program and enter a distribution, then
I used scanf("%d , %d",&a,&b); and tried to sum a and b. It gave 2 + 3 = 339 but it gave right input with scanf("%d %d",&a,&b)
I am trying to add a GtkLabel to the right of a GtkHeaderBar then change the font weight but I cannot manage to do it. I have my XML like this: <?xml version
I am trying to add a GtkLabel to the right of a GtkHeaderBar then change the font weight but I cannot manage to do it. I have my XML like this: <?xml version
I am recreating a complete shell. For that I must simulate "|". To do this, I have to use the dup2(), fork() and pipe() functions. here is my code : void do_pip
In a header file, foo.h, I have something like: extern const int array_foo[]; Then in a source file, foo.c, I have something like: const int array_foo[] = {1 ,
Does the code load the data on the linked list? and the printing method to verify that the data is present in the linkedlist, is it correct? This is the data fo
When I try to implement parenthesis problem using stack (array representation) it showing above problem. Here I use dynamic memory allocation in array. When I
I've been trying to use this gstreamer c code(my system is running on ubuntu 20.04 with GStreamer 1.16.2 and gcc 9.4.0): #include <gst/gst.h> #include <
I'm struggling figuring out how to obtain the window a specific event was triggered from. What I want to achieve is the following: Capture XCursorNotifyEvent Fi
As Joel points out in Stack Overflow podcast #34, in C Programming Language (aka: K & R), there is mention of this property of arrays in C: a[5] == 5[a] Jo
As title states the code compiles and outputs in the GCC just fine, I want to step by step follow the code in visual so I can make sure I full
Why does my terminal crash when I attempt to run this C Program? Here are the instructions for the programming exercise. #include <stdio.h> #include <