Questions tagged as 'c'

2
answers

Capture a 3D click in openGL

I'm doing a job in openGL. I wanted to click on a window and a drawing appears where it was clicked. Since the 3D eh scenario wanted to know how I can get the coordinate value in Z. Could someone tell you a step-by-step how to do? =)     
asked by 03.06.2016 / 18:32
1
answer

Error in my program C

I need to create a C program that removes (or copies) values from a queue using the output rules of a stack and adds them to a new structure. I mounted as below but two errors occur:    "undefined reference to 'WinMain @ 16'   File not fou...
asked by 04.06.2016 / 19:29
1
answer

Problems with uint64_t in C ++

I'm having trouble with very large numbers. When I put the entrance 64 my program does not display the correct answer, remembering that all smaller numbers are with normal output. Program exit: 0 kg Expected output: 153722867...
asked by 30.05.2016 / 02:14
1
answer

C - Double bursting size

I am doing an IQA (Water Quality Index) exercise where I need to conduct a series of accounts. I created the functions and everything but always the result always comes out the way it is in the image, I have already tested the isolated function...
asked by 14.06.2016 / 22:43
1
answer

Logic for Cobrinha game [closed]

Hello, I want to play a game of C in the C library using the curses library, I started, but I'm not finding a logic to draw the snake on the screen when the user presses the arrows, I want to know what a logic would be to draw it in according to...
asked by 28.03.2016 / 18:38
2
answers

Calculate vector size

How to calculate the size of the vector? My code: #include <stdio.h> #include <stdlib.h> int retornaMediana(int *vetor){ int tam=0; tam = sizeof(vetor); printf("TESTE: %d, %d, %d\n\n",vetor[0],vetor[1],vetor[2]);...
asked by 26.03.2016 / 01:55
1
answer

Struct with vector is not working

I'm trying to use vectors and struct , but it's not working. #include <stdio.h> #include <stdlib.h> typedef struct Atleta { float notas[5]; } atleta; void receberNotas(atleta* l) { int i; for(i=0; i<5; i...
asked by 28.09.2016 / 00:59
3
answers

Doubt regarding pointers in C

void imprime (char *v, int n) { char *c; for (c = v; c < v + n; v++) printf ("%c", *c); } I have this function, but I do not understand what it is doing exactly and how the pointers behave in this case.     
asked by 28.09.2016 / 21:46
1
answer

how to use the POW function in C

Good afternoon people, I've already arrived here. #include <stdio.h> #include <math.h> int main(void) { float val_carro, juros_mensal = juros_mensal / 100, num_parcelas, cf; printf("\n\n Digite o valor do carro: "); //entrada var...
asked by 23.05.2016 / 21:04
1
answer

Space in a String C

I'm starting to learn C, and I came across the following doubt: When I ask the user to inform me a song or artist, he ends up informing me of a song with spaces, type "AS I AM" , but the program skips the part of the song and the artist...
asked by 27.02.2016 / 01:13