Questions tagged as 'c'

1
answer

How to delete the contents of a file in c?

How can I delete the contents of a file in c, what function should I use? #include <stdio.h> #include <stdlib.h> void main(){ char hello[13] = "Hello World!"; char path[12] = "arquivo.txt"; FILE* arquivo; arquivo =...
asked by 27.09.2017 / 01:53
2
answers

"goto" command creating infinite loop in loop "for"

I want to simulate a school database that collects names, math and physics grades, and calculates the mean of both to 5 students (defined in a string of struct ). Any grade above 10 would be allowed, with no lock for that. Students wo...
asked by 28.09.2017 / 14:52
1
answer

Running gives me an error and I can not identify

I run my program and it goes well until I get to "l[strlen(l) - 1] = l[strlen(l)]; while (fgets(ll, sizeof (ll), "EventosDesportivosFutebol.txt") != NULL)" , (by debug I was able to find where it crashed), but I'm not able to solve the pr...
asked by 27.12.2016 / 17:20
1
answer

Join multiple mp3 files into a single mp3 file [closed]

Hello! I would like to create a program (in C language or another capable) that receives as input a text and returns me as output a song. For this I would need a text file (.txt) where I would need to read it and several audio files (.mp3) ea...
asked by 08.12.2016 / 21:05
2
answers

how do I access the values of a struct?

I need to print the read values on the keyboard of a struct vector that form a coordinate. The problem is that when I pass the struct vector of the function that picks up and stores the data for function that will print them on the screen, the o...
asked by 08.12.2016 / 00:57
3
answers

Error compiling the world [closed]

#include <stdlib> int main() { printf("Ola Mundo!\n"); return 0; } I can not run the program on Ubuntu! Compile Error     
asked by 07.08.2016 / 20:05
1
answer

How can I not display the null positions of a vector in the output?

How do I not display those gigantic numbers referring to the empty positions of my vector? My code: int main(int argc, char** argv) { double notas[10]; double soma = 0, media = 0; int i, P[10]; int j = 0, count = 0; for(i=0;i<10;i++){...
asked by 20.08.2016 / 01:51
3
answers

How to import functions from another file in C?

In Java if we create other classes, such as classe1 and classe2 , if I want to call classe1 within classe2 (since they are in seprados files) I use import classe1 / p> I made this code in C, it's an old game I...
asked by 21.09.2016 / 16:43
2
answers

Doubts about the compilation and linking phase of a C Program

I have some questions about the steps used to compile a C program. I have as a source of study the book by Luis Damas (I know that it is not advisable to have only one ...), where he says that the compilation phase consists of the syntactic v...
asked by 01.10.2016 / 17:28
1
answer

Problem with float and array

I have to add the values that have two or more decimal places but when I put it on exp: "1.0", it fills the whole row automatically and jumps to the next, I reviewed and I do not know why it is giving error so thank you if you can help. #inclu...
asked by 29.09.2016 / 23:06