#include <iostream> #include <conio.h> // для _getch() #include <clocale> // для погдключения русской локали #include <string.h> #include <stdio.h> //strcat using namespace std; int main(int argc, char *argv[]) { std::setlocale(LC_ALL, "Russian_Russia.1251"); char* slovo1 = " proger "; char* slovo2 = " riger "; //strcpy (slovo1,slovo2); strcat (slovo1, slovo2); printf(slovo1); //printf("прива"); cout << "\n" << slovo1<< "\n"; printf("прива"); std::cout << " Press <Enter> ... "; _getch(); return 0; } Unhandled exception in "0x003fd2e9 (msvcr100d.dll)" in "test1.exe": 0xC0000005: Access violation when writing "0x00a47868".
std::string. He has an operator+, and add it. For pure C, readman asprintf. - 0andriychar* slovo2 = " riger ";speech can not be, but suddenly usedstd::cout. What is this mess? - AnT