Skip to main content
0 votes
1 answer
62 views

I disassembled a 7,838,304-Byte portion of /usr/lib/x86_64-linux-gnu/dri/i965_dri.so using Capstone as shown below: #include <stdio.h> #include <string.h> #include <stdint.h> #...
TheAhmad's user avatar
  • 940
1 vote
0 answers
57 views

I mean that i is incremented by 1 right, then how does ptr + i equals ith block of memory since int size is 4? int i, n; printf("Enter the number of Integers: "); scanf("%d&...
0x0pralad0x0's user avatar
Best practices
1 vote
7 replies
170 views

So I'm making a linked list for one of my school assignments in C. I found this website that has some helpful code snippets, and I noticed that they use malloc() to allocate more memory every time ...
Klumpy7's user avatar
  • 123
2 votes
0 answers
88 views

I am trying to learn C, and I want to specifically work with arrays and matrices as I do scientific simulations (coming from python!!). After writing few basic 1-D array codes in C, I am going for ...
Sayantan4796's user avatar
0 votes
0 answers
26 views

I'm learning odin, and I'm writing a program where the map allocating memory, growing and doing its checks is a considerable part of my program running time, is there a way to have a map where I can ...
jhonny's user avatar
  • 858
3 votes
4 answers
150 views

I have a small project (ed-like text editor for myself. Just want to edit some config files using it) and I have some problems with it. workspace_file->flc = malloc(sizeof(char *)); ...
Ho1Ai's user avatar
  • 39
-2 votes
2 answers
136 views

This was a question in a C Programming assignment given to me as a part of last week's assessment. Requesting everyone to kindly explain what needs to be done and how it needs to be done. Kindly note ...
Gargi Chaturvedi's user avatar
1 vote
1 answer
123 views

I'm trying to write a queue that will store strings. Using GDB I can tell that I make a memory allocation error in the function resizeQueue. Here's the exact message: Program received signal SIGTRAP, ...
user31051859's user avatar
0 votes
0 answers
207 views

I have been having issues allocating memory on the GPU with jax. I am running on a cluster that gives me access to a RTX6000 (24GiB vram) which jax is attempting to allocate to. Output of jax....
Kepler7894i's user avatar
1 vote
1 answer
74 views

I am planning to make a Linear Regression model using C. It takes a set of m points as input from stdin using scanf. The points are defined as a struct: typedef struct{ double x; double y; } ...
Nirav Pandey's user avatar
0 votes
0 answers
16 views

Most OpenCL API calls return a status/error value, either directly or via an out-parameter (example: clCreateBuffer()). While that is not as informative as a long-form string description, it can tell ...
einpoklum's user avatar
  • 137k
0 votes
0 answers
103 views

Consider the following excerpt from Prometheus source code: func (ls Labels) String() string { var bytea [1024]byte // On stack to avoid memory allocation while building the output. b := bytes....
vtm11's user avatar
  • 409
11 votes
2 answers
367 views

The following two codes behave as expected: char* test1 = new char[20]{"abc"}; cout << test1; Outputs: abc int size = 20; char* test1 = new char[size]{'a','b','c'}; cout << ...
petat_irrumator's user avatar
1 vote
1 answer
91 views

I have a parent struct that has an array of child structs and the length of it, and within each child struct is an array of numbers and the length of it. all of the arrays are defined using pointers ...
Sterticc's user avatar
-3 votes
1 answer
171 views

I am sorry if the question is stupid. The problem is that memory for my dynamic array inside a static structure is not being allocated. The reason might be my pc (it is a really old notebook with only ...
Safarov Arthur's user avatar

15 30 50 per page
1
2 3 4 5
279