Questions tagged as 'ponteiro'

2
answers

How to receive a keyboard pointer in C / C ++?

How do I get a pointer to char via keyboard?     
asked by 17.10.2014 / 18:32
1
answer

Why can not I use || for pointer?

I have the following code: int i=0; variable a; a.type = CHAR; a.name = malloc(sizeof(char)+1); while(*l->str++ != ' '); while(*l->str != ';' || *l->str != '='){ a.name = realloc(a.name, ((!i)?1:i)*sizeof(char)+1); a.name[i] =...
asked by 07.03.2014 / 05:37
1
answer

Is there a problem in assigning a value to a pointer?

I'm referencing this site here How to declare pointers in C Normally when we want to start a variable of integer type, for example, we do int inteiro = 4; m but if we do int *inteiro_ptr = 4; can it imply something in the code...
asked by 22.06.2016 / 20:05
2
answers

Pointer operators in passing by reference

I've been studying some of the codes I found on the internet, and one of them used a prototype implementation as follows: void changeMode(Mode &m){ m.loop = true; m.quit = false; } See that the changeMode function is give...
asked by 12.06.2015 / 18:27
1
answer

How to access a pointer inside a pointer structure

I know that to access a normal variable inside a pointer structure I can use this syntax: struct teste { int valor; int *aponta; }; struct teste testando, *testado; testado = &testando; testado -> valor = 10; However, how...
asked by 28.02.2018 / 04:07
1
answer

How do I know address of each position of the vector in C?

I'm having trouble knowing the vector address and address of each vector position. #include <stdio.h> int main(){ int vec[]={52,13,12,14}; printf("Endereço de vetor %d",&vec); printf("vec[0]%d,vec[1]%d,vec[2]%d,vec[3]%d\n", &v...
asked by 26.09.2016 / 23:16
1
answer

Why does a string assignment in C not work?

I'm having trouble assigning a value to a variable of type char of a struct I'm doing the following #include <stdio.h> typedef struct Animal{ char nome[5]; // indiquei que a variavel nome tem 5 caractes int idade;...
asked by 23.06.2016 / 04:08
2
answers

Passing by reference in C

In the case of C language, when we want to pass a variable by reference we need to pass the address of the function to the function, I have a question in this case. See the example: int main(){ int *a; *a = 5; foo(&a); } void...
asked by 03.07.2015 / 19:12
1
answer

Because of this error: "return makes pointer from integer without a cast"

int *aloca_vetor(int MAX){ int i,*vetor; for ( i = 0; i < MAX; ++i) { vetor[i] = (int*) calloc (1, sizeof(int)); } return (vetor); Error: projeto.c:13:15: warning: assignment makes integer from pointer without a cast [enabled by defau...
asked by 09.08.2014 / 21:54
1
answer

How do I read these warnings

I'm doing a program that hunts a word from within an array. For this I did 8 functions that scan in all regions, as I need to return in the output the coordinates of the first and last letter. For example, I need to find the word "house" in t...
asked by 27.09.2016 / 22:57