Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~735 People Reached
Favorite Forums
Favorite Tags
c x 15
Member Avatar for ricardo.crudo

This below code is the code minimized of real code. Is posible synchronize a global variable with pthread and main while(1)? On the below code, the printf not apper in order and delayed of the 1 second. #include <pthread.h> #include <stdio.h> pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; int teste; void *ThreadFunc(void *arg) …

Member Avatar for L7Sqr
0
211
Member Avatar for ricardo.crudo

I need know what is the size of a address of one variable, in other words, how much bytes I need to store the address of a variable (in compilation time). Unhappily not is possible use sizeof in define pre-processors, like this: [CODE] #define ADDRESS_SIZE sizeof(void *) [/CODE] So, I …

Member Avatar for ricardo.crudo
0
85
Member Avatar for ricardo.crudo

Hello Everybody. I'm with a classic problem in C preprocessor concatenation. This is the situation: [CODE] #define BAUDRATE(VAL) (B ## VAL) //... const uint32_t BAUDRATE_VAL[] = {1200, 2400, 9600}; //... br = BAUDRATE(BAUDRATE_VAL[i]); //... [/CODE] This code, result in the error: BBAUDRATE_VAL undeclared I need that the result of concatenation …

Member Avatar for Narue
0
94
Member Avatar for ricardo.crudo

I have this: [B]foo(cons char *p);[/B] foo not is my function, and I don't have access to your source code. I'm trying use foo so: [B]char val[32]; foo(val);[/B] The result of foo is zero and not the desired string. Other tries: This work: [B]foo("something here");[/B] This don't work: [B]foo((cons char …

Member Avatar for Ancient Dragon
0
167
Member Avatar for ricardo.crudo

Is necessary deallocate memory of pointer-to-pointer? Example: [CODE] my_type_t **example; example = (my_type_t **) calloc(10, sizeof(my_type_t *)); for (i = 0; i < 10; i++) { example[i] = (my_type_t *) malloc(sizeof(my_type_t)); } // ... free(example); // it enough? // Or is necessary do this... for (i = 0; i < …

Member Avatar for gerard4143
0
85
Member Avatar for ricardo.crudo

Hello, I'm with difficult in this situation: [CODE] void teste(int *p_int) { printf("&p_int = %li\n", (long int) &p_int); // Line T1 printf("p_int = %li\n", (long int) p_int); // Line T2 p_int = malloc(sizeof(int)); (*p_int) = 123; printf("*p_int = %li\n", (long int) *p_int); // Line T3 } int main(void) { int …

Member Avatar for ricardo.crudo
0
93