Part 9 - Character Primitive Datatype
For a complete table of contents of all the lessons please click below as it will give you a brief of each lesson in addition to the topics it will cover. https://github.com/mytechnotalent/hacking\_c-\_arm64
Today we are going to talk about the first of the C++ primitive. The char dataype is used to store a single character and must be surrounded by single quotes.
Let’s look at our basic example.
#include <iostream>
int main()
{
char my_char = 'c';
std::cout << my_char << std::endl;
return 0;
}
Extremely simple. We are simply creating a char variable called my_char _and assigning it the character _c.
We then print it to stdout and nothing more.
Let’s compile and link.
g++ -o 0x03_asm64_char_primitive_datatype 0x03_asm64_char_primitive_datatype.cpp
Let’s run.
./0x03_asm64_char_primitive_datatype
Very simply we see the following.
c
It successfully echoed c to the terminal stdout. Very simple.
Next week we will debug this very simple example.