Сообщение от Spectator:
И начинать изучать "язык Си" с самопальной IDE не самая здравая идея
Сообщение от Yandex:
если вывод в консоль делаешь (std::cout или printf), то необходимо сконвертировать строку в 866-ю кодировку.
Сообщение от Yandex:
Spectator, Code::Block для начало самое то.
SerOver, если вывод в консоль делаешь (std::cout или printf), то необходимо сконвертировать строку в 866-ю кодировку. А вообще лучше пока забей и просто не используй национальные символы. Когда с языком разберешься, тогда и сделаешь без проблем.
Сообщение от :
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL,"russian_russia.866");
wprintf(L"%s", L"Привет!\n");
MessageBoxW(NULL, L"Привет", L"Error", MB_OK);
return 0;
}
Сообщение от Yandex:
Spectator, Code::Block для начало самое то.
Сообщение от SerOver:
Так мне нужен Си, а не СИ++
Сообщение от Spectator:
Ну да, ну да, только надо прикрутить компилятор и настроить язык
Сообщение от Spectator:
..Не легче ли скачать русскую версию Visual Studio, установить и найти кнопку компиляции?)))
Сообщение от SerOver:
Это как.
А Visual Studio с Си тоже ратотает? И если работает с СИ, то как настроить?
Сообщение от SeFuS:
попробуй:
Сообщение от :
A "string literal" is a sequence of characters from the source character set enclosed in double quotation marks (" "). String literals are used to represent a sequence of characters which, taken together, form a null-terminated string. You must always prefix wide-string literals with the letter L.
Syntax
string-literal:
" s-char-sequence opt "
L" s-char-sequence opt "
s-char-sequence:
s-char
s-char-sequence s-char
s-char:
any member of the source character set except the double quotation mark ("), backslash (\), or newline character
escape-sequence
The example below is a simple string literal:
Copy Code
char *amessage = "This is a string literal.";
All escape codes listed in the Escape Sequences table are valid in string literals. To represent a double quotation mark in a string literal, use the escape sequence \". The single quotation mark (') can be represented without an escape sequence. The backslash (\) must be followed with a second backslash (\\) when it appears within a string. When a backslash appears at the end of a line, it is always interpreted as a line-continuation character.
#include <stdio.h> #include <stdlib.h> int main() { printf("Привет! Во как!!!.\n"); return 0; }
Сообщение от SerOver:
Поставил Microsoft Visual C++ 2010 Express.
Код на С
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Привет! Во как!!!.\n");
return 0;
}
// test_rus.cpp: определяет точку входа для консольного приложения. // #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <locale.h> int main() { setlocale(LC_ALL, "Russian"); wprintf(L"%s", L"Привет!\n"); return 0; }
Сообщение от Spectator:
полный текст исходника, со всеми нужными заголовками:
Код:
// test_rus.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL, "Russian");
wprintf(L"%s", L"Привет!\n");
return 0;
}
Сообщение от SerOver:
Все равно не работает.
Пишет, что не может найти файл
код3.cpp(4): fatal error C1083: Не удается открыть файл включение: stdafx.h: No such file or directory
Без этого файла, русский вывел нормально.
Сообщение от SerOver:
Не нашел файл в Microsoft Visual C++ 2010 Express.