Posts by Fábio Morais • 1,522 points
59 posts
-
2
votes1
answer41
viewsA: Increment and Decrease Operators
I suggest you look for the difference between ++x and x++ link Ex: x=1; With x++ it prints the value 1 and only in the 2nd print prints 2 If ++x it will print 2, because it will add up first…
canswered Fábio Morais 1,522 -
0
votes1
answer363
viewsA: Doubts about renaming files in codeblocks
You need to go to the folder where the file is and just change the name, then the codeblocks updates.
codeblocksanswered Fábio Morais 1,522 -
1
votes1
answer79
viewsA: Object counter in C
A reading on the wikipedia will also help You can start by compiling and see how if le a file . bmp, follow the example: #include <stdio.h> #include <stdlib.h> typedef struct { char…
canswered Fábio Morais 1,522 -
1
votes3
answers117
viewsA: Text looks full of junk after typed
Hello, just add this line before the name scanf setbuf(stdin, NULL); #include <stdio.h> #include <string.h> int main() { int idade = 0; char nome[20]; printf("Hello! How old are you? ");…
-
2
votes2
answers765
viewsQ: Data structure in c++
Hello, when I learned C I did several libraries, since Heaps, binary trees, lists, queues...etc I wonder if in C++ there are libraries that we can import to use more easily, as with libraries…
c++asked Fábio Morais 1,522 -
1
votes0
answers69
viewsQ: Distribution addicted when using the Rand() function
Hello, how do I use the function rand() with the range Y [11, height+9] and X [11, width-1]. srand (time(NULL)); y=rand() % ((altura+9)-11) + 11; x=rand() % ((largura-1)-11) + 11; gotoXY(x, y);…
-
-1
votes2
answers511
viewsQ: Insert Image and music into a c++ project
Hello, which library allows me to insert images and music in a c++ project? Does the SDL2 library allow? Right now I have the Snake game running only on the console, but I would like to put a…
c++asked Fábio Morais 1,522 -
0
votes1
answer215
viewsA: Shuffle list in c++
Probably use the function Rand() that generates a number from 1 to 3, then with these numbers exchange the elements that have in this list of random order
-
2
votes1
answer211
viewsQ: Snake game, attempt of a beginner C/C++
Hello, I’m doing the snake game, but I’m doing it with a matrix, the way I’m doing it is to give prints and system("cls") quickly, but I’d like to know more efficient ways, like by expelling gotoxy…