October 22, 2024
Chicago 12, Melborne City, USA
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
C#

Why C debugger not prints anythings when in debugger mode

I am not able to input anything on terminal in debugger i have installed c/c++ set up, codeLLB and code runner extension i tried everything but not works!! My lanch.json: { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0",

Read More
C#

How to use sin, tan, cos, and sec in C program?

I am making a calculator using the formula on this link: http://cereference.com/book/surveying-and-transportation-engineering/simple-curves-or-circular-curves#sthash.qrD1VOm6.08csgYq9.dpbs and https://www.easycalculation.com/engineering/civil/highways-horizontal-curve.php EDITED QUESTION! So I used the math.h library in order to use the sin, tan, cos, and sec function but the answers are not right based on my formula… So to test, lets say I have an angle of 36 and

Read More
C#

How to write a program which can convert Bengali words to equivalent keywords in C program?

I’m planning to teach basic programming to my 4 year old son who knows Bengali and very basic English. As at this age he will not be able to express his thoughts in a secondary language; I’m planning to write a program which will convert the Bengali phrases to C keywords. Below is a very

Read More
C#

fmod function from math.h library in C not working correctly?

Ok, so hopefully I do not look like an idiot from asking this question…as it is quite basic, but my brain is either on vacation or something is indeed wrong. So -4 % 5 or -4 mod 5 should equal 1 correct? Why is it that the fmod function from the math.h library returns -4

Read More
C#

Find vowels in a string

Given below is my code for finding vowels in a given string: #include <stdio.h> #include <string.h> int main() { char str[100]; int i, str_length; //scanf("%[^\n]%*c", &str[100]); fgets(str, sizeof(str), stdin); str_length = strlen(str); for (i = 0; i < str_length; i++) { if (str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i]

Read More
C#

Why does my binary search need an extra comparison? log2(N)+1

I want to find the index of the first integer in an array of integers which is <= key. I can do it with binary search in log2(N)+1 compares. Shouldn’t it be possible with only log2(N) compares? // Returns the index of the first integer in keys <= key. size must be a power of

Read More
C#

Creating classes in C

is this how you guys would create a "class" in C? How about an interface? I’m guessing we just use function pointers for everything and we can change where the function pointers point to? #ifndef CLASS #define CLASS void method1() { printf("method #1"); } void method2() { printf("method #2"); } typedef struct { void (*method1)(void);

Read More
C#

Http post cannot find boundary in the end

I am now implementing an easy http server in C, and I need to deal with request that posts a video file. I am now encountering a problem. After I extract the boundary in the message, I can use strstr() function to detect the boundary in front of video content, however, it failed to detect

Read More