Struct definitions? [closed] - c

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
#include <stdio.h>
#include <string.h>
struct{int x,y;}x;
struct{int x,y;}y;
int main(void)
{
return 0;
}
Are theses declararations legal on an individual basis these structs? Could both declarations appear as shown in the code or program?

Wen a structures is declared, it represents a new scope. Therefore, each structure has it own name space. So, nothing wrong with the above snippet.

Related

#define FILE_APPVENDORPARAM APP_NAME"VENDOR" meaning of this line [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am working on one embedded project based on c language.
Can you explain me following declaration meaning:
#define FILE_APPVENDORPARAM APP_NAME"VENDOR"
Before the line you show, there must be another #define that defines APP_NAME, for example like this:
#define APP_NAME "SomeName"
Then this line:
#define FILE_APPVENDORPARAM APP_NAME"VENDOR"
defines FILE_APPVENDORPARAM as "SomeName""VENDOR" which is the same thing as "SomeNameVENDOR"

Error in C program, using VS2017 for the first time [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I getting code 0 error while compiling very simple code. How do I solve it?
I using VS 2017 for the first time.
#include <stdio.h>
void main()
{
printf("My name is Haim");
}
The two rows in the middle are not supposed to be there!
Haim
Your main() should return some exit code. So int should be as the return type.
In the other hand exit code 0 means, that everything was succesfull, see.

How could I access the memory of a running program? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Presuming I have a program in C:
#include<stdio.h>
#include<time.h>
int main()
{
int a = rand() % 1000;
return 0;
}
How can I find the value of "a" without printing it on the console, but by accessing, with a linux terminal command, its address to read the value from it?
Or generally, how can I map all the written values of a binary without seeing its implementation (like a "blackbox")?
Memory is accessible via /proc/pid/mem, index is /proc/pid/maps, Python prototype is how-do-i-read-from-proc-pid-mem-under-linux.

What does ** mean in C language? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
could anyone explain me please what does this piece of code mean?
int **d= (int**)malloc((m+1)*sizeof(int));
What are those ** for the d and the (int) ? Are they someway related to pointers?
int** d; //pointer to a pointer to an integer

offsetof with char as second argument. Is it possible? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'd love to create some part dynamically. Would it be possible to use offsetof with string as a second argument? Something like:
offsetof( tic, "close.v");
Or can I convert char to member anyhow?
The offsetof construct is a compile time operation. It can't be used with anything that is generated dynamically.

Resources