All Questions
59 questions
2
votes
1
answer
77
views
I want to pass the address of a value in a c program to an external assembler routine for modification
I have a c program (not c++) and it has a value declared as
int msgNumber = 5555
I also have an external assembler routine that the above C program calls and I want to pass it the address of the ...
0
votes
1
answer
124
views
Using modelica function as input to external "C" function
I am trying to call an external C function in modelica with a function as an argument.
So the C function needs to take a modelica "function" as input. Is it possible to do that in modelica ?...
0
votes
4
answers
639
views
Why is the external pointer causing error? [duplicate]
#include<stdio.h>
int *a,b=9;
a=&b;
void main()
{
//nothing here
}
When I run the above code in C I get 5 errors. They are:-
1) [Warning] data definition has no type or storage class
2)...
-1
votes
1
answer
191
views
why can't i access the pointer to a structure from another file and get the members
this a reproducible example and not the entire code the entire code is too large..
my problem was that i had a structure that i created using malloc and i needed to access it from another function in ...
0
votes
0
answers
289
views
Use variables values from main.c in another file
I'm trying to use variables values from my main.c in another file.c
main.c
int main(void)
{
/* USER CODE BEGIN 2 */
uint32_t StatusReg = 0U;
uint32_t NumberOfPeak = 0U;
uint32_t ...
-1
votes
2
answers
1k
views
How to access local static variables and local variables inside a function from other files in C/C++ programming?
file1.c
int b=2;
void func(){
int c=10;
static int d=10;
int *cp=&c;
}
main.c
#include <stdio.h>
#include <stdlib.h>
extern b;
extern *cp;
int main()
{
int a=1;
...
1
vote
2
answers
821
views
How can a static variable from other file accessed here on the C program below?
#include <stdio.h>
#include <stdlib.h>
int function(int);
int main()
{
int a=1;
extern b;//can be only declared
printf("a=%d\n",function(a));
printf("b=%d\n&...
12
votes
2
answers
803
views
Will a function declared inside main() have external linkage or none linkage?
See the following code:
/* first file */
int i; /* definition */
int main () {
void f_in_other_place (void); /* declaration */
i = 0
return 0;
}
/* end of first file */
/* start of second ...
0
votes
2
answers
283
views
Defining external variable externally
I've been looking around for a solution to this and despite the code fragments and explanations on SO and elsewhere it doesn't seem to work. What I want is to define a very large array externally so ...
0
votes
1
answer
34
views
Accessing external array whose typedef is also defined outside
I'm writing a code (testcode.c) to test a set of APIs. Folder structure is as shown below.
/folder
|
|-- driver.c
|-- driver.h
|-- testcode.c
I have permission to do slight modifications to ...
2
votes
0
answers
1k
views
Petalinux Recipe-app for mixed C and C++ application
I have a rather large C program that I have already written. I'm now being asked to utilize a C++ class that a co-worker has written. I'm use to working with python, so writing my application in C and ...
2
votes
1
answer
237
views
Specifying external memory for the Linker
When compiling my code, I get the Data Memory overflow-error, even though all extra variables added since last successful compile, are declared with pointers to external SRAM-memory.
I found ...
0
votes
2
answers
585
views
JNI calling a C function calling an other function in an other file
I have a problem calling a C function using an other C function from an other .c file from my Java JNI (don't mind some french words in my code, thank you). The code in C works fine.
Here are the two ...
0
votes
0
answers
42
views
Where can external libraries be added to C code?
I am answering this homework problem I need some help with.
As I understand, external libraries can be added in two places in a C file: the top, with an #include statement, and in a function body, ...
1
vote
1
answer
1k
views
External Interrupt Setup on STM32L1 doesn't run ISR
for 4 days now, I am struggling to set up External interrupt on my STM32 and I have gone through tons of reading and other people's code to get it. But no luck.
I have two buttons and when pressing ...