Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > IT форум > Помощь студентам
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 16.07.2014, 14:14   #11
Zenon
Пользователь
 
Регистрация: 03.07.2014
Сообщений: 32
По умолчанию

L - это значит строковый литерал имеет тип const wchar_t[], а не const char []
Zenon вне форума Ответить с цитированием
Старый 16.07.2014, 14:30   #12
Katyamaks
Новичок
Джуниор
 
Регистрация: 15.07.2014
Сообщений: 5
По умолчанию

Ок спасибо, задач куча, хочу решить эту, задание то принципе понятно написано, попробую сделать
Katyamaks вне форума Ответить с цитированием
Старый 16.07.2014, 14:47   #13
rrrFer
Санитар
Старожил
 
Аватар для rrrFer
 
Регистрация: 04.10.2008
Сообщений: 2,577
По умолчанию

Zenon
А спасибо, раздел 2.14.3 стандарта это описывает.
Много там, но в т.ч.:
Цитата:
haracter-literal:
’ c-char-sequence ’
u’ c-char-sequence ’
U’ c-char-sequence ’
L’ c-char-sequence ’

...

A character literal that begins with the letter u, such as u’y’, is a character literal of type char16_t. The
value of a char16_t literal containing a single c-char is equal to its ISO 10646 code point value, provided that
the code point is representable with a single 16-bit code unit. (That is, provided it is a basic multi-lingual
plane code point.) If the value is not representable within 16 bits, the program is ill-formed. A char16_t
literal containing multiple c-chars is ill-formed. A character literal that begins with the letter U, such as
U’z’, is a character literal of type char32_t. The value of a char32_t literal containing a single c-char is
equal to its ISO 10646 code point value. A char32_t literal containing multiple c-chars is ill-formed. A
character literal that begins with the letter L, such as L’x’, is a wide-character literal. A wide-character
literal has type wchar_t. 23 The value of a wide-character literal containing a single c-char has value equal
to the numerical value of the encoding of the c-char in the execution wide-character set, unless the c-char
has no representation in the execution wide-character set, in which case the value is implementation-defined.
[ Note: The type wchar_t is able to represent all members of the execution wide-character set
Я то думал это типа _T и TEXT, которые мелкософт предлагает. Я как-то не пользовался этим почти.

Последний раз редактировалось rrrFer; 16.07.2014 в 14:49.
rrrFer вне форума Ответить с цитированием
Старый 02.08.2014, 02:24   #14
challengerr
Участник клуба
 
Аватар для challengerr
 
Регистрация: 30.07.2008
Сообщений: 1,601
По умолчанию

Будет ли корректной реализации второй программы через указатель void*?
Перечисление для указания типа:
Код:
enum type
{
C_ELEPHANT,
C_RABBIT,
C_HYENA,
C_ZEBRA,
C_KANGAROO,
C_FOX
};
Однонаправленный список:
Код:
class cNode
{
public:
type animal_type;
void* animal_data;
class cNode* next;
};
Добавление животного в список:
Код:
class cZoo
{
public:
cNode *first;
cNode* next;

cZoo(){first=0; next=0;}


AddAnimal(cElephant* p){next = new cNode(); next->animal_type= C_ELEPHANT;next->animal_data = (void*)p; next ->next =0; next = next->next; }
AddAnimal(cRabbit* p){}
AddAnimal(cHyena* p){}
AddAnimal(cZebra* p){}
AddAnimal(cKangaroo* p){}
AddAnimal(cFox* p){}}
"SPACE.THE FINAL FRONTIER.This's a voyage of starship Enterprise. It's 5-year mission to explore strange new worlds,to seek out new life and civilizations,to boldly go where no man has gone before"
challengerr вне форума Ответить с цитированием
Старый 02.08.2014, 05:36   #15
rrrFer
Санитар
Старожил
 
Аватар для rrrFer
 
Регистрация: 04.10.2008
Сообщений: 2,577
По умолчанию

Что такое cZoo?
rrrFer вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Строковый тип idzaya2311 Паскаль, Turbo Pascal, PascalABC.NET 4 30.11.2013 13:02
Строковый тип Ilya_Vydysh Паскаль, Turbo Pascal, PascalABC.NET 0 25.12.2011 14:37
Строковый тип Ilya_Vydysh Паскаль, Turbo Pascal, PascalABC.NET 1 25.12.2011 00:22
Строковый тип McJordan Паскаль, Turbo Pascal, PascalABC.NET 1 26.08.2010 17:22
Строковый тип Koshmarick Помощь студентам 8 05.11.2009 12:37