
30.05.2017, 14:48
|
|
Постоянный
Регистрация: 17.01.2014
Сообщений: 493
С нами:
6483143
Репутация:
93
|
|
Сообщение от Dark_Knight
Выход за пределы.
Можно более нубским языком?
И ещё.
C++:
Код:
SAMPFUNCS
*
SF
=
new
SAMPFUNCS
(
)
;
stFontInfo
*
pFont
;
unsigned
short
scrx
=
GetSystemMetrics
(
SM_CXSCREEN
)
;
char
sstring
[
1
]
;
char
qwe
[
1
]
;
short
int
PTC
=
scrx
;
char
*
ppts
=
new
char
(
sstring
[
scrx
]
)
;
char
*
ptqwe
=
new
char
(
qwe
[
scrx
]
)
;
unsigned
__int16 nocis
;
unsigned
char
red
,
green
,
blue
;
char
*
PTCs
;
bool
CALLBACK
Present
(
CONST RECT
*
pSourceRect
,
CONST RECT
*
pDestRect
,
HWND hDestWindowOverride
,
CONST RGNDATA
*
pDirtyRegion
)
{
if
(
SUCCEEDED
(
SF
->
getRender
(
)
->
BeginRender
(
)
)
)
{
memset
(
ptqwe
,
0
,
strlen
(
ptqwe
)
)
;
memset
(
ppts
,
0
,
strlen
(
ppts
)
)
;
PTC
-=
1
;
PTCs
=
ppts
+
PTC
;
strcat
(
PTCs
,
"Число символов в строке: "
)
;
nocis
=
_scprintf
(
PTCs
)
;
itoa
(
nocis
,
ptqwe
,
10
)
;
strcat
(
PTCs
,
ptqwe
)
;
//SF->getSAMP()->getChat()->AddChatMessage(555555, "%s", ppts);
red
=
rand
(
)
;
green
=
rand
(
)
;
blue
=
rand
(
)
;
pFont
->
Print
(
PTCs
,
D3DCOLOR_ARGB
(
255
,
red
,
green
,
blue
)
,
0
,
500
,
false
)
;
SF
->
getRender
(
)
->
EndRender
(
)
;
}
;
return
true
;
}
;
с данным кодом через четверть минуты игры происходит нечто странное, что удалось разглядеть, лишь записав - после этого игра крашит.
Примечательно, что я не делал так, чтоб строка вообще клеилась, не то что уж заполняла себя своими копиями
Как такое происходит?
|
|
|