Тема: Can you?
Показать сообщение отдельно

Can you?
  #1  
Старый 11.03.2005, 11:54
PxL
Новичок
Регистрация: 22.11.2004
Сообщений: 5
С нами: 11296961

Репутация: 0
По умолчанию Can you?

Ok I have a question it`s a kind of a quest:
Can ypu overflow the buffer and call the function DontCallMe() in this sample code?

#include <stdio.h>

typedef char sbuf[10];

void getstring(sbuf is)
{
gets(is);
puts("You entered: ");
puts(is);
}

void DontCallMe()
{
puts ("Nice!");
}

void main ()
{
sbuf is = "Hi!";

puts("Enter something:");
getstring(is);
}
 
Ответить с цитированием