What do you want to save?
Add Code snippet
New code examples
-
C 2021-10-20 02:28:05
initialize char pointer c
//you should probably use dynamic memory allocation //this string is uninitialized and will cause errors char *str1; //this string is initialized, but you would have to come up with text //I would highly discourage using this method char *str2 = "Du... Add solution -
C 2021-08-29 17:56:01
increase size of array in c
#include <stdio.h>#include <stdlib.h>int main(){//a pointer to dynamically allocated memory from the heap is returned. int *a = (int *) malloc(20 * sizeof(int));for(int i = 0; i < 20; i++)a[i] = i + 1;printf("\nThe contents of the arra... Add solution
Best helpers
Ranking is empty