Questions tagged as 'c'

1
answer

Does anyone know why this program is failing?

void ordenar(struct piloto *vetor,int contador_pilotos) { int z,i,x,j; for(x=contador_pilotos-1;x<=1;x--) { for(i=0;i>x;i++) { if(strcmp(vetor[i].nome,vetor[i+1].nome)>0) {...
asked by 11.01.2017 / 16:49
0
answers

Problems with wxWidgets

I'm doing a project using wxWidgets, and when I compile the message appears: error: can not specify -o with -c, -S or -E with multiple files. I'm using codeblocks in ubuntu and I do not know what to do with this error.     
asked by 23.01.2017 / 12:53
0
answers

Runtime error in Judge Online URI?

I can not figure out the runtime error for this program. The link to the question: link #include <stdio.h> int main() { int i,j,k,count,N,M[100]; char L[100]; while ((scanf("%d",&N))!=EOF) {for(i=0;i<N;i++) scanf("...
asked by 09.12.2016 / 20:40
1
answer

array type has element type incomplete

I am not able to compile my program, the compiler is accusing "array type has element type incomplete" in function that prints points. The function that prints dot: float imprimePonto(struct armazenar p[], int n) { int i; for(i=0;i...
asked by 07.12.2016 / 12:26
1
answer

Invalid argument in mmap

I want to write to the file "server.log" and when compiling the code, the result is "Invalid argument" in the function "mmap". void MMP(){ char* addr; int fd; struct stat sb; fd = open("server.log", O_WRONLY | O_CREAT, 0700);...
asked by 25.11.2016 / 01:11
1
answer

Counters not being incremented in code

I'm having some difficulties with the code snippet below: The call to this function is: cache = OperaCache(true , endereco, op, cache, descricao, read_hits, read_misses, write_hits, write_misses); VETOR_CACHE OperaCache(bool conta...
asked by 23.11.2016 / 13:50
1
answer

"Segmentation Fault" in a function that performs Quicksort

I am doing a job that asks you to create a quicksort function to alphabetize a txt file, however it is displaying the error:    segmentation fault In the main function I call the function like this: quickSortWordsArray(vetor,0,i-1);...
asked by 16.11.2016 / 03:09
2
answers

What is the difference between assigning and comparing string variables with function or with assignment and comparison operator?

I came across the following questions: What is the difference between the expressions strcpy (s, t) e s = t ? What is the difference between the expressions if (strcmp (s, t) < 0) e if (s < t)  ? I tried to compile...
asked by 11.08.2015 / 00:44
1
answer

Program received signal sigsegv segmentation fault

I made the C code of the statement:    Develop a program that simulates a ticketing system from a   airline. The company has n flights, where in each of them there are m   places available. The first m / 2 seats on each flight are reserved fo...
asked by 12.11.2016 / 17:42
0
answers

The compilation is done without errors or warnings ... But the program does not execute!

I have some problems with the code below. The program compiles but an error occurs in the execution. I noticed the problem is in print ... due to the variable size size_t size of the struct. I have no idea how to fix this. I'm ve...
asked by 19.11.2016 / 17:59