Questions tagged as 'ponteiro'

2
answers

How do I point (with a pointer, of course) to a string, so that I can then start it?

I'll give you an example of how I'm doing but it's wrong and I wanted someone to help me fix it. #include <stdio.h> void main() { char *p; char nome[21], outronome[21]; scanf("%s", nome); * p =...
asked by 10.06.2018 / 01:16
1
answer

Why can not I print?

It's a simple code (I'm practicing pointers) It is not printing the result, the program closes ... why? ;;; #include <stdio.h> #include <math.h> #define PI 3.1416 void calc_esfera(float R, float *area, float *volume); int main(){...
asked by 27.07.2018 / 14:00
2
answers

Refinement return in C ++

I can not understand what the following function returns. int * begin(){ // return &this->data[0]; } Does such a function return the address of a reference? I did not understand very well.     
asked by 09.04.2018 / 05:04
2
answers

Change a text value through pointer in C

I need to change the values of the variables through their pointers but I can not. #include <stdio.h> #include <stdlib.h> //Programa principal int main() {//Declaração de variáveis e ponteiros int x = 0; int*p; float y = 0...
asked by 26.11.2018 / 16:43
1
answer

This is valid (x = (* mat) ++;)?

(x = (*mat)++;) If it is valid, explain to me why and how it will work.     
asked by 10.09.2017 / 23:48
2
answers

Accessing variables from a struct

I'm studying C and I'm doubtful about the difference of the following lines: (*depois).agora = 20 and *depois.agora = 20; So I understood the point . has priority and the compiler would try to solve depois.agora and after...
asked by 08.10.2017 / 18:37
1
answer

Why does this seemingly simple implementation of strupr not work?

Error implementation in GCC: char* strupr( char *str ) { while(*str) { *str++ = toupper(*str); } } Note that str is used twice in assignment .     
asked by 02.04.2016 / 14:06
1
answer

Array of strings and pointers

Read the comments in the code #include <stdio.h> int main(void) { char *nomes[2][2]; //Eu não entendo porque se eu tirar esse ponteiro * o codigo dá erro nomes[0][0]="Misael"; nomes[0][1]="Zaes"; nomes[1][0]="Joao"; nomes[...
asked by 11.08.2018 / 20:06
1
answer

Error referencing struct with pointers

I'm trying to convert this algorithm down into language c but I having trouble calling the variable and assigning a value to the p.key = 1 of the struct element. Error Code: error: request for member 'key' in something not a structure o...
asked by 04.11.2018 / 00:41
1
answer

How can I open a file in a void function?

I am trying to open a text file in a int abreArquivoEntrada function, and for this I am sending as a parameter the pointer of type FILE and a vector of char containing the file name, within the function I use to function of...
asked by 03.03.2018 / 21:47