
Learn by doing through a practical exploration of struct and enum in C, using pointers to modify values and understand the role of conditions in programming.
Learn how to set up VS Code with three extensions, including prettier and the C/C++ extension, to improve readability and catch mistakes quickly.
Create a basic player structure in C using typedef struct, declare warriors and wizards, and define fields such as health points, name, and damages for a learning by doing game.
Declare two player variables using a data structure, assign hp, energy, names, images, and power, then set damages and special attributes for each player.
Show player characteristics teaches printing and displaying character stats, including name, hp, energy, power, and special attack damage, for different players in a structured output.
Implement the playerHp() function to print a player's HP by returning an integer and accepting a data structure as an argument, enabling clear HP display.
Write an attack function that subtracts the attack damage from the opponent's hp via two pointers, and implement a special attack with higher damage.
Define a boost enumeration for potion types (none, silver, gold) and modify the attack function to apply boost-specific damages, then test that gold and silver potions reduce HP as expected.
Explore using enums and structs in C by building a player model with health points, name, and boosted attacks, then test attack and special attack functions in the main program.
In this course, you will learn with the "learning by doing" method.
Wa will use struct and enum so that you understand what these two keywords are for and how we can use them
This C programming course is quite short but effective. It aims to give you a practical aspect of programming in C in a minimum of time.
Save your time by taking this course
Why you should take this course :
This course is ideal if you want to improve with your C programming skills
You will have a base to build solid programs
You will have a better overall view of pointers, structures and enumerations
C helps you to understand the internal architecture of a computer, how computer stores and retrieves information. After learning C, it will be much easier to learn other programming languages like Java, Python, etc. Opportunity to work on open source projects.
The notions that we see in this course can be used in C++ too, a language very close to C
C is the programming language most commonly used and recommended for writing operating systems.
Who this course is for :
Anyone who wants to better understand C programming
For those who want to learn new things
Hope i'll see you in this course !
Join us now!