View Code of Problem 52

#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	char arr[50];
	gets_s(arr);
	int len = strlen(arr);
	for (int i = 0; i <= len / 2; i++)
	{
		char c;
		c = *(arr + i);
		*(arr + i) = *(arr + len - 1 - i);
		*(arr + len - 1 - i) = c;
	}
	printf("%s", arr);
}

/*
Main.c: In function 'main':
Main.c:7:2: warning: implicit declaration of function 'gets_s' [-Wimplicit-function-declaration]
  gets_s(arr);
  ^
/tmp/cchhwHA1.o: In function `main':
Main.c:(.text+0x15): undefined reference to `gets_s'
collect2: error: ld returned 1 exit status
*/

Double click to view unformatted code.


Back to problem 52