408,146 questions
Best practices
0
votes
2
replies
63
views
Implications of VLA Compound literal GCC extension
Browsing through the GCC docs, I noticed the following:
As a GNU extension, GCC allows compound literals with a variable size. In this case, only empty initialization is allowed.
And indeed, the ...
Advice
1
vote
4
replies
144
views
C Programming Concepts in real world
I need some help from the industry experts, as I have been struggling with Programming. I have been working in the practical field at a factory shop. My work is to repair and make new items, and I ...
Best practices
3
votes
4
replies
118
views
Best way to parse assembly
I’m having some trouble parsing assembly efficiently. I read https://www.cs.tufts.edu/comp/150VM/modules/04asm.html, but I don’t like the approach of parsing assembly files twice for label resolution.
...
Advice
0
votes
4
replies
81
views
Mosquitto C - Sending a struct as a payload
In a project I'm working on where I want to, among other things, send config variables from one client to another; I've decided that I want to try and use a struct as a payload so that there's a clean,...
Best practices
0
votes
2
replies
43
views
NVcompositor in Gstreamer Pipeline Reusability
Does NVcompositor in Gstreamer Pipeline is reusable ?
In my pipeline , I can't able to reuse the pipeline after 1st iteration , the pipeline receives SIGSEG.
How to solve this issue
Is there any ...
Best practices
0
votes
2
replies
54
views
How should ID's be accessed/issued in ECS?
I have been writing a simulation that uses ECS, and i wanted to ask what the best practice would be for issuing/using IDs.
My main question is: Should the index of the component be the ID, or should ...
Advice
2
votes
8
replies
187
views
Reference vs Pointers
There is a significant difference between a reference and a pointer. But I want to ask at the low level how are they different. Some people say that references are just pointers under the hood but and ...
1
vote
0
answers
95
views
C Driver using a cursor to update documents causes a read to fail after first update
I am using the latest version for the C driver (2.3.1) and MongoDB 8.3 and I am finding that the following code fails on the second call to cursor next after the first update call. The error variable ...
Advice
0
votes
26
replies
289
views
how pointers are implemented internally
I am new to programming and learning about pointers in C , although it's easy but I want to know how pointers are implemented internally within systems because I want to be a system software so I am ...
1
vote
0
answers
69
views
GDB hook-stop not triggered when next/step is interrupted by a software breakpoint (__BKPT)
I experiencing a specific behavior in GDB where the standard hook-stop is completely bypassed if a next (Step Over (F10)) or step (Step Into (F11)) command is interrupted by a software breakpoint ...
Advice
1
vote
7
replies
137
views
main.h doesn't appear in preprocessed file
When I generate the preprocessed file of check.c, why is only main2.h included and not main.h?
The file structure:
directory:
main.h
main2.h
main.c
main2.c
check.c
main.c:
int add(...
Tooling
0
votes
1
replies
135
views
Where are some public test suites for C printf implementations?
I am looking for public printf test suites that can be used easily to test your own implementation.
Preferably
the tests use a common unit test framework,
cover the full functionality by comparison ...
Tooling
0
votes
11
replies
360
views
Making the prefix 0o for octal numbers mandatory?
Most people on this planet have no idea what octal numbers are. For this it would be better to make the prefix 0o for octal numbers in parsers mandatory. However, the behaviour for base 0 of strtol ...
2
votes
2
answers
141
views
Drawing image.png in Gtk3 DrawingArea
I'm trying to draw a .png image in a GtkDrawingArea, using libgtk-3-0 and libcairo2. Simple, right? But my code fails for some reason.
Below is a stripped down version of my code. It can be compiled ...
2
votes
2
answers
235
views
How to convert a string to unsigned string [closed]
I have a hexadecimal value in a string; I want to convert it to unsigned string.
#include <stdio.h>
int main()
{
char string_hexadecimal[100] = "5a2be26e5ef51ad833c153";
...