Mọi người cho em hỏi phần khai báo trong main()
sao cho đúng ạ?
Đề bài:
#include <iostream>
#include <vector>
#include <string.h>
using namespace std;
void reverse(char *s) {
int n = strlen(s);
for (int i = 0; i < n/2; i++) {
char k = *(s + i);
*(s + i) = *(s + n - 1 - i) ;
*(s + n - 1 - i) = k;
}
for (int i = 0; i < n; i++) {
cout << s[i] ;
}
}
int main () {
char* s;
cin >> *s;
reverse(s) ;
}