Questions tagged as 'c'

1
answer

Use Import or Include in C / C ++?

#import <stdio.h> or #include <stdio.h> What is the correct way to use it? I was seeing videos on YouTube for some time.     
asked by 06.02.2018 / 22:38
1
answer

How to use if-else sets correctly in C?

I'm having a problem with this code in DevC ++, as I see the part of the if-else conditions is perfectly indented and organized (all if has its else and its keys). The error is in the last else , but I do not know how...
asked by 26.10.2018 / 03:57
1
answer

What's wrong with my dynamic stack?

I'm trying to make a dynamic stack, and for some reason something is wrong with the init function. You are giving the following error:    warning: conflicting types for 'init' #include <stdio.h> #include <stdlib.h> type...
asked by 18.03.2018 / 04:25
1
answer

Print threaded list in C

I'm creating a program that receives a vector and creates a linked list. I need help to create the "print ()" function, which prints the generated threaded list. I do not know how to proceed. #include <stdio.h> #include <stdlib.h>...
asked by 03.09.2016 / 18:53
2
answers

What is wrong with the logic of this code that adds numbers tracks?

My algorithm needs to sum all values between a and b , for example if I type a=3 e b=6 the program needs to speak 3 7 12 18 (3+4= 7/ 7+5=12 / 12+6=18) only it only makes the first two then it starts to err. #include &...
asked by 13.05.2018 / 03:47
2
answers

Password Validator in C [closed]

I'm trying to solve the problem 2253 - Password Validator , but it is giving 10% wrong answer, but all my tests are working, can anyone find the error? #include <stdio.h> #include <string.h> #include <ctype.h> int validade(c...
asked by 24.09.2017 / 03:08
1
answer

How to reference mat [x] [y] in pointer notation

I'm working with programming in c , specifically with pointers and dynamic allocation, I need to respond to an exercise that asks for the following:    How to reference mat [x] [y] in pointer notation.     
asked by 16.10.2017 / 02:43
2
answers

How to use a dynamically allocated vector returned from a function in C?

I have a dynamic-sized vector that was created in a function and need to return it to the main function. The function that returns is as follows: int* uniao(int *v1, int n1, int *v2, int n2){ int *v3; int i, j = 0; //Aloca dina...
asked by 01.11.2017 / 16:53
1
answer

Segfault no fwrite. Because?

Why is this program giving segfault ? struct{ int matricula; char nome[50]; }Aluno; int main(){ FILE *arq; if((fopen("alunos.txt", "w")) == NULL){ printf("Nao foi possivel abrir o arquivo.\n"); return 1;...
asked by 07.11.2017 / 15:08
1
answer

How to sort array structures based on song rank?

The rank of the code is going in increasing order but the others do not change the positions along with the rank, how do I position the songs and styles to go along with the code? #include <stdio.h> #include <locale.h> struct musi...
asked by 08.11.2017 / 23:56