Questions tagged as 'c'

1
answer

Power function returning incorrect values inside the while loop

I have a function power that returns the value of a potentiation by receiving the parameters n and p ( n^p ). Out of the loop while the function returns the correct values, however inside the loop the functi...
asked by 05.05.2018 / 17:11
2
answers

Is it possible to somehow overload functions in C

I am in doubt about C. I have already programmed a time in C in procedural programming, but for some months I started to program object oriented. In Java, it is possible to overload functions. As Java is an object-oriented language that was deve...
asked by 02.05.2018 / 04:49
1
answer

How do I create a CSV in C by incrementing the first number?

I generated this csv: 1;0 2;0 2;0 2;0 2;1 2;2 2;2 2;2 2;2 2;3 ... How do I get the first number of each line to increment it? And how can the first line not be skipped? int gerarRelatorioHash(int colisoes) { FILE *pont_arq;...
asked by 05.07.2018 / 02:04
1
answer

What does "order an array" mean, either by rows or columns?

What does "order an array" mean, either by rows or columns?     
asked by 04.07.2018 / 05:47
2
answers

How can I export the output to a text file in C?

I want to pass the program output to a .txt file, how would I do it?     
asked by 24.07.2018 / 22:10
1
answer

Find string inside string without library string.h?

My function needs to check if a string is contained in another and say where the first place where the letter was the same occurred but is always returning the size of the first string What's wrong with my implementation? My code: void s...
asked by 16.06.2018 / 03:16
2
answers

Meaning of two asterisks in function call [duplicate]

I'm trying to understand a code on list simply chained. The function InserirInicio is set to Nodo **inicio, float dado . I could not understand the use of two asterisks in the parameter in this function in specific, would be fun...
asked by 22.12.2017 / 00:50
1
answer

Binary tree printing only the left side

Hello. My binary tree is only printing the left side, what can it be? I'm using TAD to implement. Tree structure: typedef struct _no { int conteudo; struct _no *esquerda; struct _no *direita; struct _no *pai; } Arvore; In...
asked by 29.08.2018 / 00:28
2
answers

Why this code gives segmentation fault?

Whenever the first line of the map is populated a segmentation fault occurs, I would like to know why. void newmap(int x, int y , int players){ int linha,coluna; char **map = (char **) malloc(sizeof(char*) * y); *map = (char *)m...
asked by 14.08.2018 / 00:44
1
answer

Why can not I read this character?

I'm new to programming; the question of the question is this:    Given as input data the name, height and sex (M or F) of a   person, calculate and show your ideal weight using the following   formulas:       • for males: ideal weight = (72....
asked by 28.10.2017 / 20:28