Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- int main(){
- char** string_list = (char**) malloc(12); //3 * 4 bytes
- string_list[0] = (char*) malloc(30); //30 bytes pentru text.
- string_list[1] = (char*) malloc(30); //30 bytes pentru text.
- string_list[2] = (char*) malloc(30); //30 bytes pentru text.
- strcpy(string_list[0], "Hello world!");
- strcpy(string_list[1], "The brown fox.");
- strcpy(string_list[2], "jumps over the lazy dog.");
- printf("%c\n", string_list[0][0]);
- printf("%c\n", *(string_list[0]));
- printf("%c\n", (*string_list)[1]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement