Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
1 vote
4 answers
178 views

Is passing a reference to a primitive from C++ to C context undefined behaviour?

I'm wondering about the behaviour of passing references of an int or float from C++ to C. So the called function expects an int, but I call with an int& Is this defined? The compiler will ...
Gideon Geier's user avatar
0 votes
1 answer
38 views

Pass dynamic array ponter into func in C ending with "Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)"

I need to change params char array in parser function, but after leaving parser function params array is still NULL and it ends with "Process finished with exit code 139 (interrupted by signal 11:...
Xhar's user avatar
  • 11
0 votes
1 answer
51 views

Passing by pointer a struct instance initialized within one function on to another function in C yields different results using GCC

(I'm doing this for a personal project - just to learn how things like pointers/references/memory management work with C language. I want to do this "without cheating", i.e. without any aid ...
AndrewGreen's user avatar
-2 votes
2 answers
131 views

simple address book program with struct in C

I have a problem related with this program : #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct people { char full_name [100]; char age [100]; ...
DeadlyKitten999's user avatar
0 votes
1 answer
37 views

a function called inside a procedure with arguments passed by reference not working properly in c language

I used x as an integer variable and defined this procedure that calls another procedure. The &x in choix_pion is probably causing issues to the code. How can I fix it? Or should I rather declare x ...
Elas's user avatar
  • 21
1 vote
0 answers
51 views

Why the write function does not print the 'asd' integer variable? [duplicate]

I'm currently learning pointers and the write function. I've written the code below. My question is the write functions does not print anything at all. In the write function's manual, it says that the ...
Huseyin Donmez's user avatar
0 votes
0 answers
126 views

My C Code exe only runs on my PC. How do I Include VCRuntime140.dll in my C code exe

I have recently been getting in C code. I would like to create a stand alone .exe that can run on a windows PC. The exe runs on my pc, of course because of the installation. However, on another PC I ...
Gareth Swemmer's user avatar
0 votes
0 answers
20 views

&array_name in C [duplicate]

So I understand that the array name represents the first address of the array. Thus, printf("%d", name5); should return an address. However, I realized printf("\n%d", &name5); ...
user20766406's user avatar
0 votes
1 answer
63 views

What is wrong with my linked list, and why won't it properly set my head to NULL in C?

This is my program I have written in C, I created a structure and a head and I am trying to make a linked list, but I keep getting read access violations and it seems I am not passing in my head ...
The Elina's user avatar
0 votes
1 answer
39 views

Understanding references to members in a struct within a struct, as well as how to dynamically allocate memory for struct members

I've looked at a few different questions with regards to the problem I am facing and while I feel like I've gained some insight I definitely have questions that I could use help with, so I wanted to ...
CortadoLover's user avatar
-1 votes
2 answers
41 views

C: Referencing 2D array through multiple functions

I've been trying to make a tic tac toe game with the miniMax algorithm, but have run into a problem with accessing the array at the miniMax function: if (checkGameOver(board[3][3]) != 0); and the ...
hanni's user avatar
  • 1
1 vote
3 answers
2k views

VScode right click misses limited and Go to definition and more are not working

I have a project in C language, and many options I used to do are not working anymore. For example: CTRL + hover: doesn't show the definition. CTRL + click: doesn't go to the definition. Right click ...
Ophir Gruteke's user avatar
-7 votes
2 answers
65 views

Why am I getting an output of always 1 in the below code

I was writting a program to assign the Value of N to M in the declaration statement.If i gave value of N in declaration i get the same value in output.But if i read from user ,i am getting 1 always #...
Bhagat Singh's user avatar
0 votes
1 answer
38 views

Why am I getting an 'expected identifier before (' when attempting to refer to values within struct

I can do free(STRUCTPOINTER->thing1->thing2) but I can't do free((*STRUCTPOINTER).(*thing1).thing2) (Expected identifier before ( token. For (*thing1 nor can I do free((*STRUCTPOINTER).thing1....
mistahwhite's user avatar
1 vote
0 answers
142 views

How to determine in Clang API if a reference is to a global?

Using the Clang Python API I am trying to figure out if a reference to a C identifier is to a global definition - i.e. the scope of the identifier is more than to just a single file or sub-part ...
Steve V's user avatar
  • 11

15 30 50 per page
1
2 3 4 5
27