Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define LEN 100
- void new_line(char (**line)[LEN], int n) {
- *line = calloc(n * LEN, sizeof(char));
- for (int i = 0; i < n; i++) {
- sprintf((*line)[i], "test %d", i);
- }
- }
- int main(void) {
- const int n = 10;
- char (*line)[LEN] = { NULL };
- new_line(&line, n);
- for (int i = 0; i < n; i++) {
- printf("%s\n", line[i]);
- }
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement