Questions tagged [c]

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,503 questions
0votes
0answers
3views

Doxygen including comments from another file

I usually include a module overview and usage guidelines in comments somewhere at the top of .c files. I would like this information to appear within the detailed description generated by Doxygen but ...
  • 111
0votes
0answers
11views

How write a dynamic loader that wraps C variadic functions?

In order to avoid depending on a library at run-time I have written a dynamic loader that uses dlopen / dlsym to load functions form a library at run-time. To link at build time I use wrapper ...
0votes
1answer
12views

free(): invalid pointer error on compilation after attempting to copy a string using a function

I am trying to copy a string using a function: #include <stdlib.h> #include <stdio.h> char *_strdup(char *str); /** * main - Entry point of my program * * Return: Always 0. */ int ...
0votes
2answers
30views

Why aren't these two strings equivalent? C [duplicate]

I'm currently working my way through CS50x and just tinkering around with some of the practice problems from Week 1 and testing the limits of my knowledge. Could someone help me understand why the two ...
0votes
0answers
18views

Showing Error - undefined reference to '[email protected]'

#include<stdio.h> int mainI() { int a, b, c; printf("enter a"); scanf("%d",a); printf("enter b"); scanf("%d", b); printf("...
0votes
1answer
32views

How would I modify the C compiler to work with a different base system other than decimal (heximal, dozenal, etc)?

What functions and features need to be changed in the C compiler and standard library, to be able to write and compile code in a separate base system? Obviously, there's trouble that comes from using ...
0votes
1answer
47views

Scanf() stores a newline when I type characters 'i' or 'n'

I'm trying to have my program end if the user types 'end' and while brainstorming for an implementation, one of the solutions I came up with has an interesting behavior. In the code below, numbers are ...
0votes
0answers
22views

Tensorflow-Lite not recognizing interpreter

This is my code: #include <iostream> #include <cstdio> #include <iomanip> #include "src/VideoProcessing.h" #include <opencv2/opencv.hpp> #include <opencv2/videoio....
  • 2,689
0votes
1answer
37views

Using Scanf function in C for some period of time

The requirement of my program is, it should move to next line without waiting for the user to enter while using Scanf(). The user have to enter the input within that period of time. What I can do so ...
0votes
0answers
10views

Is there any possible for kernel to free the task_struct already but still maintain its pid structure?

I am a newbie in Linux kernel and have the following question. These days, I find the following code for a Linux kernel exploitation. /* * Add @count to a struct pid by connecting @count times * to ...
0votes
0answers
26views

C coding style question - using global variable vs static variable & wrapping function

there is a global variable which indicates whether booting is done. I am using vim with cscope, so whenever I try to find assignment or definition of this variable, it shows all symbols. So, I want to ...
-8votes
0answers
33views

How to solve this [closed]

I'm stuck here cannot get over this problem. Problem Consider a currency system in which there are notes of six denominations, namely. Rs1, Rs 2, Rs 5, Rs 50, Rs 100. If the sum of Rs N is input, ...
0votes
0answers
19views

I2C read() lost 1 bit

I try to use I2C to read data from ADS1110, the address of ADS1110 is seven bits, which is 1001 000. Writing data can only change the configuration register, which is done in the form of address + ...
0votes
0answers
18views

UV position appears to shift when vertex is outside view frustum

I have an issue where, when rendering a face where one vertex is behind the view frustum, the UV coordinate of that vertex appears to shift and the fragment shader appears to sample the wrong position ...
-3votes
0answers
41views

Converting C union to C++ syntax [closed]

I was converting a library that does simple json parsing and was working great in C. I had to move to C++ to use another library, but now I can't get the json_value_u union to work. I already adapted ...

153050per page