putchar function in C Programming

https://youtu.be/je4jonog5uo #include <stdio.h> int main(void) { char a = 'B'; // putchar(a); char myArr[] = "Hello"; for (size_t i = 0; i < (sizeof(myArr) / sizeof(myArr[0])); i++) { putchar(myArr[i]); }…

The scanf function in C

https://youtu.be/Xej6FKu63cA #include <stdio.h> int main() { printf("Please enter a single character: "); char c; scanf("%c", &c); printf("You entered: %c\n", c); printf("Please enter an integer number : "); int i; scanf("%d",…

The realloc function in C Programming

https://youtu.be/pueYFVgLb7o #include <stdio.h> #include <stdlib.h> int main() { int *ptr = malloc(sizeof(int)); if (ptr) { printf("Allocated bytes : %zu\n", sizeof *ptr); } int *newPtr = realloc(ptr, 10 * sizeof(int)); if…

The calloc function in C Programming

https://youtu.be/MpF-_J91P2A #include <stdio.h> #include <stdlib.h> int main() { int *ptr = calloc(1, sizeof(int)); int *arrPtr = calloc(3, sizeof(int)); if (ptr) { printf("The initial Value is : %d\n", *ptr); *ptr =…

malloc function in C programming

https://youtu.be/Sp29Gz2Mars #include <stdio.h> #include <stdlib.h> typedef struct malloc_example { char a; int i; } MyStruct; int main() { MyStruct *sptr = malloc(sizeof(MyStruct)); int *ptr = malloc(sizeof(*ptr)); char *cptr = malloc(sizeof(char));…