Questions tagged as 'c'

1
answer

Console cursor coordinates in C

Taking the following code as an example: #include <stdio.h> int main(void) { printf("Hello world"); return 0; } Where "Hello World" will be written on line 1 and column 1 of the console. How do I change this, for example, typ...
asked by 02.09.2015 / 15:57
2
answers

Problem with malloc

Galera, to make a small program that given any number, enters a function that divides the number into a vector and returns the number of decimal places (number of positions) that the vector has. In all the guides and tutorials I see says that th...
asked by 06.09.2015 / 23:46
1
answer

Open background application in C - Linux

I'm programming a watchdog for my system, at the beginning of the code I need to run the application in the background, for this I use the command: system ("./ meuprogram &"); But the program understands the '&' (required to open b...
asked by 05.08.2015 / 00:21
2
answers

Generate random number without repetition in C

Hello, I am making a memory game in c, and would like to know how to generate a random number without repetition. I will post what in the function so far. Do I need to do another function only to check if there is a repeated number? void preen...
asked by 21.06.2015 / 22:14
2
answers

String reading and input buffering

I've always used the fgets () function to read keyboard strings, since it (at least I thought so) always clears the input buffer. However, I'm encountering some errors with running the function in the case of the code below. The strings are not...
asked by 20.09.2015 / 16:33
1
answer

Allegro Debug -Abort () Has Been Called

I tried to make an animation and Visual Studio gives the error Debug -Abort() Has Been Called . Code: #include <allegro5\allegro.h> #include <allegro5\allegro_native_dialog.h> #include <allegro5/allegro_image.h> con...
asked by 05.07.2015 / 22:10
2
answers

How to monitor a C code in Linux

I was trying to use top to monitor the performance of my codes in c, but when I run the program does not appear. Is it there just not visible, or can not monitor c-codes using the top? What should I use to monitor if the top does not work? The c...
asked by 02.06.2015 / 13:35
1
answer

Union and type conversion

Searching about unions I found the following information: Unions are generally used for type conversions. For example, we can use a union to write the binary representation of an integer in a disk file. First we create a union between a...
asked by 12.09.2015 / 14:39
1
answer

Learn ABC in C language?

How do I in this code, when it enters a letter read by the keyboard with the scanf of type (char) it repeats until the Z? #include <stdio.h> #include <stdlib.h> int main() { char c; /*for (c= 'A'; c<='Z'; c++){...
asked by 13.05.2015 / 15:24
2
answers

How do I enter complex numbers in C ++?

I know I've asked a question like this before. It was about Python. But in C ++, how do you insert a complex number?     
asked by 10.05.2015 / 09:02