Skip to content

lebogangolifant/alx-low_level_programming

Repository files navigation

System engineering & DevOps

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games.

Project Objectives

  • Entry point
  • Print text
  • Unary operator
  • Compiling
  • C coding style

General Requirements

  • Editors: emacs, vi, vim
  • Files will be compiled on Ubuntu 20.04 LTS using gcc, using the options -Wall -Werror -Wextra -pedantic -std=gnu89
  • Scripts should be two lines long: $ wc -l <filename>
  • Use Betty to check coding style

Installation

Betty Linter

To run the Betty linter just with command betty <filename>:

  • Go to the Betty repository
  • Clone the repo to your local machine
  • cd into the Betty directory
  • Install the linter with sudo ./install.sh
  • emacs or vi create a new file called betty, and copy the script below:
  #!/bin/bash
  # Simply a wrapper script to keep you from having to use betty-style
  # and betty-doc separately on every item.
  # Originally by Tim Britton (@wintermanc3r), multiargument added by
  # Larry Madeo (@hillmonkey)

  BIN_PATH="/usr/local/bin"
  BETTY_STYLE="betty-style"
  BETTY_DOC="betty-doc"

  if [ "$#" = "0" ]; then
      echo "No arguments passed."
      exit 1
  fi

  for argument in "$@" ; do
      echo -e "\n========== $argument =========="
      ${BIN_PATH}/${BETTY_STYLE} "$argument"
      ${BIN_PATH}/${BETTY_DOC} "$argument"
  done
  • Once saved, exit file and change permissions to apply to all users with chmod a+x betty.
  • Move the betty file into /bin/ directory or somewhere else in your $PATH with sudo mv betty /bin/.

You can now type betty <filename> to run the Betty linter!

Project Directories

PROJECTS DIRECTORY
1. C - Hello, World 0x00. C - Hello, World
2. Variables, if, else, while 0x01. C - Variables, if, else, while
3. C - Functions, nested loops 0x02-functions_nested_loops
4. debugging 0x03-debugging
5. more, functions, nested, loops 0x04-more-functions-nested-loops
6. C - Pointers, arrays and strings 0x05-pointers_arrays_strings
7. C - More pointers, arrays and strings 0x06-pointers_arrays_strings
8. C - Even more pointers, arrays and strings 0x07-pointers_arrays_strings
9. C - Recursion 0x08-recursion
10. C - Static libraries 0x09-static_libraries
11. C - argc, argv 0x0A-argc_argv
12. C - malloc, free 0x0B-malloc_free
13. C - More malloc, free 0x0C-more_malloc_free
14. C - Preprocessor 0x0D-C_Preprocessor
15. C - Structures, typedef 0x0E-Structures_typedef
16. C - Function pointers 0x0F-Function_pointers
17. C - Variadic functions 0x10-Variadic_functions
18. C - Singly linked lists 0x12-Singly_linked_lists
19. C - More singly linked lists 0x13-More_singly_linked_lists
20. C - Bit manipulation 0x14-Bit_manipulation
20. C - File I/O 0x15-File_I/O

Acknowledgements

ALX Africa

About

C Programming Language basics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages