Questions tagged as 'c'

0
answers

I'm using the OpenGL lib, but in compiling the gcc is returned undefined reference, could anyone help?

#include <GL/gl.h> #include <GL/glut.h> void reshape(int w, int h) { glViewport(0, 0, w, h); /* Establish viewing area to cover entire window. */ glMatrixMode(GL_PROJECTION); /* Start modifying the projection matrix. */ glLoadIdent...
asked by 19.11.2017 / 03:53
0
answers

Understanding the quick sort algorithm graphically

I have this code working properly. #include <stdio.h> #include <stdlib.h> #include <string.h> void quicksort (int *vetor, int inicio, int fim) { int i, j, meio, aux; i = inicio; j = fim; meio = vetor [(inicio+fim)/2]; do...
asked by 06.11.2017 / 14:53
1
answer

Receiving a user's data and displaying this data at the end

I want to receive the data of a user and at the end when I run the program I want to show them, but I think that the variable is not so, because the program jumps from name to age directly, and address and does not leave, what I intend is to cre...
asked by 07.11.2017 / 13:14
1
answer

Error executing program in C

I have to create a movie signup program, however when I run the program and it error and I do not know why it does not run, can you help me? #include <stdio.h> #include <locale.h> #include <string.h> #include <stdlib.h>...
asked by 05.11.2017 / 23:22
1
answer

Doubts about storing values in a variable

I'm having trouble understanding this while loop: #include <stdio.h> main() { int c; c = getchar(); while (c != EOF) { putchar(c); c = getchar(); } } The result of an execution is this: $ ./teste teste tes...
asked by 16.11.2017 / 05:08
1
answer

How to pass an array that was allocated to a function in C?

Good evening, I have a question, which is as follows. -Enter a program that dynamically allocates an array (of integers) of dimensions defined by the user. Then fill in the positions of the matrix and print out all the elements. In the end, c...
asked by 16.11.2017 / 03:02
0
answers

How to use conio.h in netbeans

I am doing a protection in c of the game hanoi tower. I needed to use the library but I can not, whenever I try to add a da-me error. if anyone can help me.     
asked by 31.10.2017 / 15:49
2
answers

Array of struct accepting more than defined, what's wrong?

In the code I created an array of type Pessoa containing only 2, but when it begins to iterate in the for loop and accesses index 2 and 3 the string continues without generating compile-time error nor execution. Is this behavior normal?...
asked by 10.11.2017 / 02:01
1
answer

Exercise Vectors, I'm stranded

It is intended to elaborate a program that asks integers to the user and saves them in a vector, this procedure is repeated until the user enters the value zero. At the end the program should show all the values that the user entered. You sho...
asked by 22.10.2017 / 14:47
0
answers

Get values from an audio file

I'm trying to use a c ++ library to detect frequencies of a sound. To use it I need to pass a double type vector with the audio samples. I managed to get a vector but for this I had to use android so he pick up audio from the microphone read in...
asked by 22.10.2017 / 07:39