|
|
@ -1,4 +1,24 @@ |
|
|
|
# Lecture 4: An overview of C and C++ |
|
|
|
A long this lecture let us test two basic Hello World scripts on C and C++, respectively. The idea is to remember the compilation chain process to obtain an executable application. |
|
|
|
|
|
|
|
## C-code |
|
|
|
## The Hello-Wolrd on C |
|
|
|
The code used for this example is |
|
|
|
```c |
|
|
|
//Gerardo Marx 24/04/2021 |
|
|
|
#include <stdio.h> |
|
|
|
int main(int argc, char *argv[]){ |
|
|
|
printf("Hello World from BeagleBoard!!\n"); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
``` |
|
|
|
|
|
|
|
then to compile on an executable code use |
|
|
|
```bash |
|
|
|
$ gcc hello-world.c -o <output-name> |
|
|
|
``` |
|
|
|
here the `<output-name>` is the name that you want for your executable code. |
|
|
|
|
|
|
|
Now it is possible to execute your new code by using: |
|
|
|
```bash |
|
|
|
$ ./<output-name> |
|
|
|
$ Hello World from BeagleBoard!! |