Все вопросы: [c11]

2 вопросов

похожие теги: c++11
7
голосов
3ответов
813 просмотров

Potential problem with C standard malloc'ing chars

When answering a comment to another answer of mine here, I found what I think may be a hole in the C standard (c1x, I haven't checked the earlier ones and yes, I know it's incredibly unlikely that I alone among all the planet's inhabitants have found a bug in the standard). Information follows: ...

1
голосов
1ответов
2289 просмотров

Scanf_s () для начинающих

int main(void) { char tmp, arr[100]; int i, k; printf("Enter a string: "); scanf_s("%s", arr); for ( k = 0, i = (strlen(arr) - 1); k < (int) (strlen(arr) / 2); --i, ++k) { tmp = arr[k]; arr[k] = arr[i]; arr[i] = tmp; } puts(ar...