For boolean logic there are two states. It is either True or False. There is not any other way it could be. Considering that computers have to convert things to a True or False 1 ...
Author - Lugsole
Bio
Just learning
Social
02 if else logic
If else logic The first thing needing to learn about computer logic id its boolean most always. 1#include <stdio.h>2 3 4int main() { 5 int z = 2; 6 int y = 1; 7 printf("This is a test\n"); 8 if (z == 1) { 9 printf("a\n"); 10 }else if (z = 2) { 11 printf("b\n"); 12 if (y == 2) { 13 printf("b1\n"); 14 } else { 15 printf("b2\n"); 16 } 17 return true; 18 } else { 19 printf("c\n"); 20 } 21} 22 23 ...
03 Basic IO
The first thing to learn is IO. This comes in a variaty of formes. The fist one that comes to mind would be text based IO like that of the terminal. ...
04 Data Types
The first thing to learn is IO. This comes in a variaty of formes. The fist one that comes to mind would be text based IO like that of the terminal. ...
05 Operators
The first thing to learn is IO. This comes in a variaty of formes. The fist one that comes to mind would be text based IO like that of the terminal. ...
06 Controol flow
Controol flow Before you begin You should hace read the operators section These are split into a few different catagories. Boolean logic This is just a refresher of the If Else For loop While loop Go to ...
07 Function
...
08 Data structures
...
09 01 02 Linked List
Linked List A linked list contains a few diferent parts. The first is the item. The second would be the a pointer to the next item. Advantage This data structure allows for any number of items be able to be added to a collection without copying a bun ch of data like would be the case in a vector. Features Get item Insert item Delete item Length Search Get next item Get last item Last item in list First item in list Code 1struct linked_node { 2 void *data; 3 struct linked_node *next; 4 struct linked_node *previous; 5} 6 7/** @brief This gets the data from the linked list item 8* 9* 10* @param node The linked list node 11* @return Address to the item at the linked list node 12*/ 13void * linked_data(struct linked_node *node) { 14 return node->data; 15} 16 17/** @brief This gets the next node in the linked list 18* 19* 20* @param node The linked list node 21* @return Address to the next linked list item 22*/ 23struct linked_node * linked_next(struct linked_node *node) { 24 return node->next; 25} 26 27/** @brief This gets the next node in the linked list 28* 29* 30* @param node The linked list node 31* @return Address to the next linked list item 32*/ 33struct linked_node * linked_length(struct linked_node *node) { 34 int length = 0; 35 while(node) 36 { 37 ++length; 38 node = node->next; 39 } 40 return length; 41} ...
10 Networking
...