• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/11

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

11 Cards in this Set

  • Front
  • Back
To change the console text?
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0);


//replace the 0 with a number for the color you want
What's does Sleep(3000) do?
It makes the program sleep for 3 seconds.
How to include a Beep sound.

Beep(Frequency, Length in MSeconds)
#include <windows.h>

int main()
{
Beep(80, 500); return 0;
}
How do you add a library to CODE::BLOCKS?
You go into Project Build and then you link the library. You just type in the name of that library.
One way you can add sound?
First, you have to add the winmm library to the project. Next, add the
#include <windows.h> into your source. Then, the syntax would be

PlaySound("SoundFile", NULL, SND_ASYNC);

ex.

PlaySound(TEXT("C:\\buzz.wav"), NULL, SND_FILENAME | SND_ASYNC);

Remember to include two slash symbols. "\\". One won't work.

You would also need a system("PAUSE) or something to pause the program to listen to the file.
Where can you edit where your music, graphic files are stored? For example, when you want to call the PlaySound(); function?
Execution working directive.

Ex. C:\Users\Desktop

This will let you play audios if the audio is stored in the desktop.
How do you add libraries?
Ex. Alright, so I downloaded the SFML library. I then had to put all of the lib files, including dlls and such in the MingGW lib folder. Then, I had to put the SMFL folder in the include folder in the MingGW for some reason. Then, When I want to use the API of the library, I need to include the header file and also include the lib in my projects. Remember, you must include the libs in descending order of which lib needs which lib. It's kind of confusing but once you start going into libs it makes much more sense.
What should you do for your compiler to find libs or other needed files?
Sometimes your compiler is stupid and so you would need to use the Environment Path inside of the Advanced settings of "My Computer". You have to include the path in where you store all of your files. I added the MingGW lib file path to it in order for it to find all my lib files, because, before I did this, it wouldn't find my DLL files.
What can a sprite be used for?
It can be used to look like a character in a program.
What does it mean to make a variable static?
If you declare this in a mytest.c file:

static int my_variable;
Then this variable can only be seen from this file. The variable cannot be exported anywhere else.

If you declare inside a function the value of the variable will keep its value each time the function is called.

A static function cannot be exported from outside the file. So in a *.c file, you are hiding the functions and the variables if you declare them static.
Friends.
A friend can access the private and protected members of another class. You have to declare another class a friend inside the class you want to use.