http://pastebin.com/g5dJAAYM#
It turns out that such an error in this code ... What could it be?
The code is made in Visual studio.
- @ Ramil Ibraev, Try to write more detailed questions. Explain where you see the problem, where exactly it appears, how to reproduce it, etc. - Nicolas Chabanovsky ♦
1 answer
Decide whether you are writing C or C ++. In the code is a wild mix. The code can be reduced by an order if you write on normal pluses.
You do not need to mix the input / output (puts, scanf, getchar) and plus (
std::cin,std::out) ways without deep understanding. This in most cases leads to a strange conclusion.The string
strcpy_s(t[i],(strlen(b) + 1),b);. I understand that Microsoft was thinking about its functions, but try not to use such a replica. There is a normal functionstrncpy, which has the necessary functionality.It is absolutely not clear what data the program wants and what exactly it will do with it. You need at least one example of input data and the desired result.
But this error occurs precisely because somewhere inaccurately accessing memory. But where ... it is difficult to restore, I compiled an example, but absolutely do not understand what to enter there.