Questions tagged as 'c'

0
answers

Optimize slow heap implementation

The goal of my program is to implement a limited size heap , whose entries are just numbers. To set the priority of each element, it is necessary to search when it will repeat again for the first time. The higher the priority, the higher the he...
asked by 13.11.2016 / 22:50
0
answers

How to draw frames on the console, along with accented words?

I use the BoxDraw function below to draw frames in a program with text-mode (console) output. I can not use this function if I use words with an accent, because when I include the <locale> library (for menu words like "Rep...
asked by 25.10.2016 / 06:31
2
answers

Compare char in an array function

I'm making a game of old and I need to compare the positions if they are the same to verify the winner, but it is not working. Here is the code: #include <stdio.h> #include <string.h> void exibir(); int checaLocal(char matriz[...
asked by 20.10.2016 / 17:24
1
answer

Print all results of a vector with a certain value

I'm starting the studies in C. I have a question about how to go through a vector looking for a value in it and print showing with printf all the values found. The program I'm doing: link In the above program, it would be case 5,...
asked by 30.11.2016 / 12:18
1
answer

Ordering method Bubblesort with dynamic allocation + pointer

Hello everyone. I'm trying to solve an exercise by bubblesort ordering method and dynamic allocation (no pointers and no dynamic allocation the exercise gets easier, however, the teacher asked to do with AD). The exercise is simple, it is to say...
asked by 15.09.2016 / 21:37
2
answers

Divide vector according to delimiters and copy content to other strings in C

I need the main string "vector" to be traversed to the delimiter '=' and copy the previous values to '=' to 'second' and values after '=' to 'third'. Sure there is a smarter way to do this, but since I'm a beginner, I'm having a hard time figuri...
asked by 26.09.2016 / 06:51
0
answers

Reading a special char type using locale does not work. How to correct?

I'll give you a simple example to explain my doubt: #include <stdio.h> #include <conio.h> #include <locale.h> main(){ setlocale(LC_ALL,"Portuguese"); char a; printf("Insira um caractere especial,\nExemplos: ç,...
asked by 25.08.2016 / 06:19
1
answer

In C language, I can not work properly with an array

Hello. In a college project to automate the end-to-end encryption process, I encountered some problems when dealing with arrays. NOTE: Sorry for the formatting errors of the code. I have not got the hang of it yet. #include <stdio.h> #in...
asked by 24.08.2016 / 18:51
3
answers

What is the purpose of returning the main function and the importance of this function?

I would like to know what is the importance of the function main and what is the purpose of the return of it that is an integer? Here is a minimal example of the implementation of the main function: int main() { printf("St...
asked by 21.04.2016 / 03:40
0
answers

Write / Read large files

I'm having a bit of trouble in an academic project where I have to generate a certain number of records to have an X-sized file. Eg 20gb of a .bin for so many records. My problem is how to do this as soon as a file like this pops up th...
asked by 29.08.2016 / 16:42