Questions tagged as 'c'

1
answer

Permission denied accessing file

I have a function in my program where it shows all the students registered in a binary file, the user selects which one to delete, a confirmation screen with the user data waiting for the input appears for then deletion confirmation occurs....
asked by 08.11.2014 / 13:43
2
answers

Read a string separated by a comma

My reading has been set to the point of comma, but he is reading every field to the end of the line when you read the string. The code is read correctly, but only in code. #include <stdio.h> #include <string.h> struct setorEletron...
asked by 02.12.2014 / 19:36
1
answer

How to resume all students with common names

I am developing a program that has to manage a canteen of a school and on the menu I have an option to search for student by number and another to search for all students who have the first name in common. Here is my code, where I can not see my...
asked by 25.12.2014 / 00:38
1
answer

Can improve

Good to have how to improve? I believe so. But improve what? the code leaves you lighter, improve performance these things. I would like tips and because I am still studying. I'll post 3 vector codes below. #include <stdio.h> #include &l...
asked by 08.08.2014 / 03:38
3
answers

Problem with fscanf using code :: blocks and OpenGL

Does anyone know if there is any restriction on using fscanf in projects that use GLUT (OpenGL)? I'm trying to do something simple ... read a cloud of points (x, y, z) from a text file, but fscanf does not get the values correctly...
asked by 03.02.2015 / 22:21
2
answers

Error reading, strings and integers

#include <stdio.h> struct tetris{ char nome[16]; int pontuacao; }; int main(){ int i, nteste = 1, J, k, total = 0, maior, menor, pontos; while (scanf("%d\n", &J) && J != 0){ struct tetris jogado...
asked by 03.09.2015 / 05:07
2
answers

Size of a vector of characters according to their addressing

Is the size of a character vector given by its address or variable value? Example: char[1000] = "Exemplo Teste" Is the length of this variable 1KB due to its char[1000] address or its size is 13 because of its content?     
asked by 26.12.2018 / 21:40
2
answers

Declaration of a global array of structures in C

I created a cliente structure and the next idea would be to create an array clientes . My idea would be to declare the array clientes globally, so that all functions can interact without being passed as an input parameter...
asked by 21.12.2018 / 22:04
1
answer

How can I subtract from an array with multiple positions with the same number in C?

The activity asks me to report a number of wagons and then asks me to assign a weight to each of them. I calculate the average of these weights and then subtract the average of the weights of each one of them to reach a common weight. Here is...
asked by 03.01.2019 / 18:09
1
answer

How to create a dialog to open files with the SDL library?

I'm making a very simple audio player in C (in Ubuntu) for a college job, and I'm using the SDL library to create windows (graphical interface) along with the SDL_mixer to play the audio. The problem is: I need a way for the user to point the...
asked by 15.02.2014 / 22:03