408,306 questions
0
votes
0
answers
49
views
minimax max implementation for ultimate tic tac toe giving unexpected results [closed]
i've been attempting to create a version of the minimax algorithm, for ultimate tic tac toe as a learning project, but my current implementation looses consistently to a player playing random moves.
...
0
votes
0
answers
27
views
MPI_Type_create_darray distributes data correctly but MPI_Scatterv ignores offsets, sending same data to all processes
I'm trying to cyclically distribute row blocks of a matrix (represented as a 1D array) across processes using MPI_Type_create_darray.
After creating the datatype and inspecting it with ...
-8
votes
0
answers
128
views
Why does it keep promting me? [closed]
When I run this code:
#include <stdio.h>
#include <cs50.h>
int main(void)
{
int counter = 0; // Initialitzate counter
const int increment_every_time = get_int("What number do ...
2
votes
0
answers
69
views
Android (Linux) libc problems when creating an execuatable shared object
I have 2 files:
crt.c:
const char service_interp[] __attribute__((section(".interp"))) = "${LD_SO}";
extern void _exit (int __status) __attribute__ ((__noreturn__));
int main();
...
2
votes
0
answers
87
views
Packet corruption in Lockless ring buffer (multiple producer, single consumer)
I Am implementing Lockless ring buffer for multiple producer and single consumer (keeping in plan to extend it to multiple produce and consumer)
using design reference of dpdk buffer : https://doc....
1
vote
1
answer
76
views
The NEO-8M produces incomprehensible characters
I have that code:
#include <stdio.h>
#include <stdbool.h>
#include <unistd.h>
#include "esp_system.h"
#include "esp_timer.h"
#include "freertos/projdefs.h&...
-1
votes
0
answers
93
views
Which compiler optimizations can break code without volatile when calling through function pointers? [closed]
Here is the code:
void (*volatile sys_func)(void);
void
main(int argc, char **argv) {
int i, j;
for (j = 0; j < 3; ++j) {
for (i = 0; i < 10000; ++i);
sys_func();
}
...
1
vote
0
answers
58
views
Possible to Use Source Files Outside the Workspace Root?
I'm trying to use C source files that are located outside my Ceedling project root. My repository has shared code in a common/ folder at the repo root, but my Ceedling project is in boards/CANGateway/....
Best practices
1
vote
12
replies
127
views
C memory initialization for a char** after a malloc
I've been researching this for a day and I've found a lot of conflicting information on multiple websites. I'm writing a simple test that will allocate and initialize a char** (array of strings, char*...
0
votes
0
answers
152
views
Monitoring changes to variables programmatically
This is a follow up to my previous question about creating a debugger for C source files in Python. The current issue I am facing is monitoring changes to variables. I want to monitor 8 variables say ...
-10
votes
0
answers
60
views
Unable to open Snapshot using VDDK [closed]
{"level":"error","ts":1764409482.772595,"caller":"vddk-service/service.go:125","msg":"Failed to open disk","error":"...
4
votes
3
answers
141
views
The reason of there being constraints on the second argument of `va_start()`
I've found that there are conditions that the second argument of va_start(ap, last) must satisfy, which are:
last must not be a register variable
last must not be a function
last must not be an array
...
-3
votes
0
answers
84
views
Whitesmith autoindentation of C/C++ code in VSCode [duplicate]
How can I get autoindentation to use Whitesmith style for C/C++ files in VSCode? I use Microsoft C/C++ Extension pack and clang-format. "Format Document" works ok with C/C++ files.
There is ...
2
votes
1
answer
127
views
Is it possible to load a function symbol from an executable
I have 2 files:
foo.c:
#include <stdio.h>
int Main(int a) {
printf("A%dB",a);
}
int main() {
return Main(1);
}
bar.c:
extern int Main(int);
int main() {
return Main(2);
}
...
1
vote
0
answers
38
views
__TMS320C28XX__ are not defined at ccs20.3 when using F2800137 cputimer function [closed]
When I use the F2800137 DSP chip to develop a CPU timer code with ccs20.3 version, I find that the macro named __TMS320C28XX__ in cputimer.h file is not defined, which leads to me not being able to ...