0

Сделаем массив строк:

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char **string_array[] = {"digital", "analog", "tester", "smartphone", NULL};
    for (int i = 0; i < 3; i++) {
       printf("%s\n",string_array[i]);
    }

    return 0;
}

как сделать цикл который бы пробегал по буквам сначала 'd' потом 'i'... потом также с другой строкой.

1 ответ 1

0
char *string_array[] = {"digital", "analog", "tester", "smartphone", NULL};

for(int i = 0; i < 4; i++) {
    for(int j = 0; j < strlen(string_array[i]); ++j)
        printf("-%c",string_array[i][j]);
    puts("");
}

Так сойдет?

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.