Beratcan Yaz
Hectopat
- Katılım
- 24 Mart 2020
- Mesajlar
- 102
- Çözümler
- 1
Kod:
#include<iostream>
using namespace std;
int main() {
const char* s = "evren";
char c[6] = "evren";
cout << strlen(s) << endl;
cout << strlen(c) << endl;
char *x=(char*)malloc(sizeof(char)*6);
strcpy(x,s);
cout << x << endl;
}
#include<iostream>
using namespace std;
int main() {
const char* s = "evren";
char c[6] = "evren";
cout << strlen(s) << endl;
cout << strlen(c) << endl;
char *x=(char*)malloc(sizeof(char)*6);
strcpy(x,s);
cout << x << endl;
}
Bu kod Visual Studioda çalışmıyor. Başka derleyicide çalışıyor. Yardım edebilir misiniz?