October 22, 2024
Chicago 12, Melborne City, USA
C#

Video game “manager” class in C

I am new to C and I am wanting to make a video game. I was wondering what you all thought of this structure. My goal is to be able to easily access functions and data from a single struct. This way I only need to include one file everywhere. #include <stdio.h> #include "lib/manager/manager.h" #include

Read More
C#

A Windows-compatible C IDE that will be able to compile FFmpeg?

I want to set up an environment on my PC (Win7x64) that I will be able to combine these projects and compile them into one executable: FFmpeg AMV codec tools For this I need an environment that can compile/debug both the above projects (creating a Windows compatible exe). Any ideas? You need to sign in

Read More
C#

Questions about the GCC compiler and linker

Say your program is composed of two source files (main.c and auxiliary.c) and two header files (declarations.h and auxiliary.h). Then you run the compiler as follows: $gcc main.c auxiliary.c -o myprogram Question 1: Will the compiler create one single object file for my program (i.e., just the libraries are missing) or will it create two

Read More
C#

Real world project structure with .C and .H

So when we make a C program we just need one .C file right? We can include additional C files and H files to our main .C file but I’m not sure what the difference between them is. Why would one create multiple .C files? Couldn’t they just create a bunch of .H files and

Read More
C#

minimum write size with O_DIRECT

I am writing a custom database engine for Linux 2.6.X kernels in C and I need to know what is the minimum write size of a write() system call for a file opened with O_DIRECT flag? In the docs it says that since linux 2.6 kernel versions you can use 512 byte block. But, what

Read More
C#

A program that prints its input one word per line

I want to print one word per line but the output is not printing the last character of each word. Can anyone help in finding the error? #include <stdio.h> #define IN 1 /* Inside a text */ #define OUT 0 /* Outside a text */ main() { int c,nw,state; state=OUT; while((c=getchar())!=EOF) { if(c==' '||c=='\n'||c=='\t') {

Read More
C#

C compiler for windows that compiles raw binaries?

I need a C compiler that can compile raw binaries (No structure or headers). I tried using GCC and I could not do it. Anyone have any suggestions? You need to sign in to view this answers

Read More
C#

Can't correctly print to serial UART using AVR-c on ATMEGA328P Arduino Uno

I’m trying to program an ATMEGA328P Arduino Uno "bare metal" to print to serial over the USB connection to my computer, however I only see replacement characters (�) being printed, both when using screen /dev/ttyACM0 9600 and when using the Arduino IDE serial monitor. I’ve tried different baud rates to no avail, although the baud

Read More
C#

How can cli still work when memory manager doesnt give it memory? Custom OS x86_64

Developing a memory manager and for some reason cli works normally even when memory manager doesnt give it memory? When memory manager is initialised cli retrieves a bit of memory from it and Memory Manager correctly recongises it as allocated memory. Is there any explanation for this or is it a issue? Adding Memory Manager

Read More
C#

Performance benefits of Rust vs C for microsecond-precision serial port I/O, and inter-process communication with Qt

I have a time-sensitive C program that performs serial port I/O with microsecond-level precision. The program currently works well and meets our requirements. I have two questions: Would there be any significant advantages to rewriting this program in Rust, particularly in terms of performance or reliability for such precise timing operations? Currently, the program writes

Read More