You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
713 B

4 years ago
  1. # Lecture 4: An overview of C and C++
  2. 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.
  3. ## The Hello-Wolrd on C
  4. The code used for this example is
  5. ```c
  6. //Gerardo Marx 24/04/2021
  7. #include <stdio.h>
  8. int main(int argc, char *argv[]){
  9. printf("Hello World from BeagleBoard!!\n");
  10. return 0;
  11. }
  12. ```
  13. then to compile on an executable code use
  14. ```bash
  15. $ gcc hello-world.c -o <output-name>
  16. ```
  17. here the `<output-name>` is the name that you want for your executable code.
  18. Now it is possible to execute your new code by using:
  19. ```bash
  20. $ ./<output-name>
  21. $ Hello World from BeagleBoard!!