Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef struct {
- int* int1;
- char* char1;
- } numeros_s;
- void loadSettings(//char fileName [], struct configParam* paramsReaded [], int* length,
- numeros_s* num[]){
- // (*num) = (int*) malloc(sizeof(int));
- // (*num)[1] = 1;
- // (*num)[5] = 5;
- (*num) = malloc(sizeof(numeros_s)*5);
- (*num[0]).int1 = malloc(sizeof(int));
- *num[0]->int1 = 5;
- //(*num)[1].int1 = malloc(sizeof(int));
- *(num+1)->int1 = 10;
- }
- int main(){
- numeros_s* i;
- printf("%p\n", i);
- loadSettings(&i);
- printf("%d\n", *i[0].int1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement