• 15 апреля стартует «Курс «SQL-injection Master» ©» от команды The Codeby

    За 3 месяца вы пройдете путь от начальных навыков работы с SQL-запросами к базам данных до продвинутых техник. Научитесь находить уязвимости связанные с базами данных, и внедрять произвольный SQL-код в уязвимые приложения.

    На последнюю неделю приходится экзамен, где нужно будет показать свои навыки, взломав ряд уязвимых учебных сайтов, и добыть флаги. Успешно сдавшие экзамен получат сертификат.

    Запись на курс до 25 апреля. Получить промодоступ ...

русские символы в консоли

  • Автор темы lamez
  • Дата начала
Статус
Закрыто для дальнейших ответов.
L

lamez

новая проблема. В консоли пишутся только ancii, подскажите плиз как это исправить.
И где найти windows.h?????
 
M

[m7]Zeitgeist

Код:
#include <windows.h>
#include <iostream>
....
//описваем ф-цию

char* Rus(const char* text);
......
//ф-ция main

.....
void main()
{
cout<<Rus("Тест")<<endl;
{

char bufRus[256];

char* Rus(const char* text)
{
CharToOem(text, bufRus);
return bufRus;
}
 
L

lamez

Спасибо большое,[m7]Zeitgeist!!! Но \Microsoft Visual Studio 8\VC\include не содержит windows.h/
Дайте ссылку или выложте плиз этот заголовок.
 
L

lamez

Есть только папка sdk, но .h файлов в ней нет(а также в ниже стоящих папках), вообще файлов с именем windwows, которые распознавались бы как текст нет. Вот мои папки.
D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 8
+---Common7
¦ +---IDE
¦ ¦ +---1033
¦ ¦ +---ExceptionAssistantContent
¦ ¦ ¦ +---1033
¦ ¦ +---HTML
¦ ¦ ¦ +---XMLLinks
¦ ¦ ¦ +---1033
¦ ¦ +---PublicAssemblies
¦ ¦ +---VCExpress
¦ ¦ ¦ +---NewFileItems
¦ ¦ +---VS SCC
¦ ¦ +---Xml
¦ ¦ +---1033
¦ +---Packages
¦ ¦ +---1033
¦ ¦ +---Debugger
¦ ¦ ¦ +---1033
¦ ¦ ¦ +---Visualizers
¦ ¦ +---schemas
¦ ¦ +---xml
¦ +---Tools
¦ +---VDT
¦ +---1033
+---Microsoft MSDN 2005 Express Edition - ENU
+---Microsoft Visual C++ 2005 Express Edition - ENU
¦ +---Logs
+---MSDN Express Library
¦ +---1033
+---SDK
¦ +---v2.0
¦ +---Bin
¦ +---Bootstrapper
¦ ¦ +---Engine
¦ ¦ ¦ +---de
¦ ¦ ¦ +---en
¦ ¦ ¦ +---es
¦ ¦ ¦ +---fr
¦ ¦ ¦ +---it
¦ ¦ ¦ +---ja
¦ ¦ ¦ +---ko
¦ ¦ ¦ +---pt-BR
¦ ¦ ¦ +---ru
¦ ¦ ¦ +---zh-CHS
¦ ¦ ¦ +---zh-CHT
¦ ¦ +---Packages
¦ ¦ ¦ +---DotNetFX
¦ ¦ ¦ ¦ +---en
¦ ¦ ¦ +---SqlExpress
¦ ¦ ¦ ¦ +---en
¦ ¦ ¦ +---WindowsInstaller3_1
¦ ¦ ¦ +---en
¦ ¦ +---Schemas
¦ +---Docs
¦ ¦ +---1033
¦ +---Lib
+---VC
¦ +---bin
¦ ¦ +---1033
¦ +---Express
¦ ¦ +---VCAddClass
¦ ¦ ¦ +---Generic
¦ ¦ ¦ +---VCNet
¦ ¦ +---VCProjectItems
¦ ¦ ¦ +---Code
¦ ¦ ¦ +---Data
¦ ¦ ¦ +---PropertySheets
¦ ¦ ¦ +---UI
¦ ¦ +---VCProjects
¦ ¦ +---General
¦ ¦ +---VCNet
¦ ¦ +---Win32
¦ +---include
¦ ¦ +---CodeAnalysis
¦ ¦ +---msclr
¦ ¦ ¦ +---com
¦ ¦ +---sys
¦ +---lib
¦ +---Profile
¦ +---VCNewItems
¦ +---vcpackages
¦ ¦ +---1033
¦ +---VCProjectDefaults
¦ +---vcprojectitems
¦ +---vcprojects
¦ ¦ +---General
¦ ¦ +---vcNET
¦ ¦ +---Win32
¦ +---VCWizards
¦ +---1033
¦ ¦ +---Images
¦ +---AppWiz
¦ ¦ +---.NET
¦ ¦ ¦ +---ClassLibrary
¦ ¦ ¦ ¦ +---Scripts
¦ ¦ ¦ ¦ ¦ +---1033
¦ ¦ ¦ ¦ +---Templates
¦ ¦ ¦ ¦ +---1033
¦ ¦ ¦ +---Console
¦ ¦ ¦ ¦ +---Scripts
¦ ¦ ¦ ¦ ¦ +---1033
¦ ¦ ¦ ¦ +---Templates
¦ ¦ ¦ ¦ +---1033
¦ ¦ ¦ +---EmptyProject
¦ ¦ ¦ ¦ +---Scripts
¦ ¦ ¦ ¦ +---1033
¦ ¦ ¦ +---WinForm
¦ ¦ ¦ +---scripts
¦ ¦ ¦ ¦ +---1033
¦ ¦ ¦ +---templates
¦ ¦ ¦ +---1033
¦ ¦ +---Generic
¦ ¦ +---Application
¦ ¦ ¦ +---html
¦ ¦ ¦ ¦ +---1033
¦ ¦ ¦ +---images
¦ ¦ ¦ +---scripts
¦ ¦ ¦ ¦ +---1033
¦ ¦ ¦ +---templates
¦ ¦ ¦ +---1033
¦ ¦ +---MakefileProject
¦ ¦ +---HTML
¦ ¦ ¦ +---1033
¦ ¦ +---Images
¦ ¦ +---Scripts
¦ ¦ ¦ +---1033
¦ ¦ +---Templates
¦ ¦ +---1033
¦ +---CodeWiz
¦ +---.NET
¦ ¦ +---Component
¦ ¦ ¦ +---scripts
¦ ¦ ¦ ¦ +---1033
¦ ¦ ¦ +---templates
¦ ¦ ¦ +---1033
¦ ¦ +---DataSet
¦ ¦ ¦ +---scripts
¦ ¦ ¦ ¦ +---1033
¦ ¦ ¦ +---templates
¦ ¦ ¦ +---1033
¦ ¦ +---WinForm
¦ ¦ +---Scripts
¦ ¦ ¦ +---1033
¦ ¦ +---Templates
¦ ¦ +---1033
¦ +---Generic
¦ +---Class
¦ ¦ +---HTML
¦ ¦ ¦ +---1033
¦ ¦ +---Images
¦ ¦ +---Scripts
¦ ¦ +---1033
¦ +---PropertySheet
¦ ¦ +---Scripts
¦ ¦ ¦ +---1033
¦ ¦ +---Templates
¦ ¦ +---1033
¦ +---ResourceScript
¦ +---scripts
¦ ¦ +---1033
¦ +---Templates
¦ +---1033
+---Xml
+---1033
¦ +---Snippets
¦ +---xsd
¦ ¦ +---Attributes
¦ ¦ +---ComplexTypes
¦ ¦ +---Elements
¦ ¦ +---Extensions
¦ ¦ +---Misc
¦ ¦ +---SimpleTypes
¦ +---xslt
¦ +---html
¦ +---xslTags
+---Schemas
+---1033
+---MSBuild
 
S

SunSanych

У меня он лежит в c:\DevTools\VS2003\Vc7\PlatformSDK\Include\Windows.h
А еще, если программа нормально компилируется, то можно кликнуть на имени файла правой кнопкой мыши и в выпадающем меню выбрать Open Document "Имя файла" , он откроется, а потом посмотреть его свойства.
 
L

lamez

Как я понял вся проблема в том, что у меня \MICROSOFT VISUAL STUDIO 8 полная багов итп, ибо мелкомягкие любят сервиспэчить. Может кто мне запакует архивчик с .h вайлами. Буду благодарен всем сердцем.
 
S

sdriver

windows.h -- Не знаю, как приатачивать из VS6
Код:
/*++ BUILD Version: 0001	Increment this if a change has global effects

Copyright (c) 1985-1997, Microsoft Corporation

Module Name:


windows.h

Abstract:

Master include file for Windows applications.

--*/

#ifndef _WINDOWS_
#define _WINDOWS_


#ifndef WINVER
#define WINVER 0x0400
#else	
#if defined(_WIN32_WINNT) && (WINVER < 0x0400) && (_WIN32_WINNT > 0x0400)
#error WINVER setting conflicts with _WIN32_WINNT setting
#endif
#endif

#if(WINVER >= 0x0500)
#pragma message ("")
#pragma message ("NOTE: WINVER has been defined as 0x0500 or greater which enables")
#pragma message ("Windows NT 5.0 and Windows 98 features. When these headers were released,")
#pragma message ("Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.")
#pragma message ("")
#pragma message ("For this release when WINVER is defined as 0x0500 or greater, you can only")
#pragma message ("build beta or test applications. To build a retail application,")
#pragma message ("set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk")
#pragma message ("to see if retail Windows NT 5.0 or Windows 98 headers are available.")
#pragma message ("")
#pragma message ("See the SDK release notes for more information.")
#pragma message ("")
#endif

#ifndef _INC_WINDOWS
#define _INC_WINDOWS

#if defined (_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

/* If defined, the following flags inhibit definition
*	 of the indicated items.
*
* NOGDICAPMASKS	 - CC_*, LC_*, PC_*, CP_*, TC_*, RC_
* NOVIRTUALKEYCODES - VK_*
* NOWINMESSAGES	 - WM_*, EM_*, LB_*, CB_*
* NOWINSTYLES	  - WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
* NOSYSMETRICS	 - SM_*
* NOMENUS		  - MF_*
* NOICONS		  - IDI_*
* NOKEYSTATES	  - MK_*
* NOSYSCOMMANDS	 - SC_*
* NORASTEROPS	  - Binary and Tertiary raster ops
* NOSHOWWINDOW	 - SW_*
* OEMRESOURCE	  - OEM Resource values
* NOATOM			- Atom Manager routines
* NOCLIPBOARD	  - Clipboard routines
* NOCOLOR		  - Screen colors
* NOCTLMGR		 - Control and Dialog routines
* NODRAWTEXT		- DrawText() and DT_*
* NOGDI			 - All GDI defines and routines
* NOKERNEL		 - All KERNEL defines and routines
* NOUSER			- All USER defines and routines
* NONLS			 - All NLS defines and routines
* NOMB			 - MB_* and MessageBox()
* NOMEMMGR		 - GMEM_*, LMEM_*, GHND, LHND, associated routines
* NOMETAFILE		- typedef METAFILEPICT
* NOMINMAX		 - Macros min(a,b) and max(a,b)
* NOMSG			 - typedef MSG and associated routines
* NOOPENFILE		- OpenFile(), OemToAnsi, AnsiToOem, and OF_*
* NOSCROLL		 - SB_* and scrolling routines
* NOSERVICE		 - All Service Controller routines, SERVICE_ equates, etc.
* NOSOUND		  - Sound driver routines
* NOTEXTMETRIC	 - typedef TEXTMETRIC and associated routines
* NOWH			 - SetWindowsHook and WH_*
* NOWINOFFSETS	 - GWL_*, GCL_*, associated routines
* NOCOMM			- COMM driver routines
* NOKANJI		  - Kanji support stuff.
* NOHELP			- Help engine interface.
* NOPROFILER		- Profiler interface.
* NODEFERWINDOWPOS - DeferWindowPos routines
* NOMCX			 - Modem Configuration Extensions
*/

#if defined(RC_INVOKED) && !defined(NOWINRES)

#include <winresrc.h>

#else

#if defined(RC_INVOKED)
/* Turn off a bunch of stuff to ensure that RC files compile OK. */
#define NOATOM
#define NOGDI
#define NOGDICAPMASKS
#define NOMETAFILE
#define NOMINMAX
#define NOMSG
#define NOOPENFILE
#define NORASTEROPS
#define NOSCROLL
#define NOSOUND
#define NOSYSMETRICS
#define NOTEXTMETRIC
#define NOWH
#define NOCOMM
#define NOKANJI
#define NOCRYPT
#define NOMCX
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_MIPS_) && !defined(_X86_) && defined(_M_IX86)
#define _X86_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_MRX000)
#define _MIPS_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_ALPHA)
#define _ALPHA_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_PPC)
#define _PPC_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_M68K)
#define _68K_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_X86_) && !defined(_MIPS_) && defined(_M_MPPC)
#define _MPPC_
#endif

#ifndef _MAC
#if defined(_68K_) || defined(_MPPC_)
#define _MAC
#endif
#endif

#ifndef RC_INVOKED
#if	 ( _MSC_VER >= 800 )
#pragma warning(disable:4001)
#pragma warning(disable:4201)
#pragma warning(disable:4214)
#pragma warning(disable:4514)
#endif
#include <excpt.h>
#include <stdarg.h>
#endif /* RC_INVOKED */

#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#ifdef _MAC
DECLARE_HANDLE(HKEY);
typedef HKEY *PHKEY;
#endif
#if !defined(_MAC) || defined(_WIN32NLS)
#include <winnls.h>
#endif
#ifndef _MAC
#include <wincon.h>
#include <winver.h>
#endif
#if !defined(_MAC) || defined(_WIN32REG)
#include <winreg.h>
#endif
#ifndef _MAC
#include <winnetwk.h>
#endif

#ifndef WIN32_LEAN_AND_MEAN
#include <cderr.h>
#include <dde.h>
#include <ddeml.h>
#include <dlgs.h>
#ifndef _MAC
#include <lzexpand.h>
#include <mmsystem.h>
#include <nb30.h>
#include <rpc.h>
#endif
#include <shellapi.h>
#ifndef _MAC
#include <winperf.h>

#if(_WIN32_WINNT >= 0x0400)
#include <winsock2.h>
#include <mswsock.h>
#else
#include <winsock.h>
#endif /* _WIN32_WINNT >= 0x0400 */

#endif
#ifndef NOCRYPT
#include <wincrypt.h>
#endif

#ifndef NOGDI
#include <commdlg.h>
#ifndef _MAC
#include <winspool.h>
#ifdef INC_OLE1
#include <ole.h>
#else
#include <ole2.h>
#endif /* !INC_OLE1 */
#endif /* !MAC */
#endif /* !NOGDI */
#endif /* WIN32_LEAN_AND_MEAN */

#ifdef _MAC
#include <winwlm.h>
#endif


#ifdef INC_OLE2
#include <ole2.h>
#endif /* INC_OLE2 */

#ifndef _MAC
#ifndef NOSERVICE
#include <winsvc.h>
#endif

#if(WINVER >= 0x0400)
#ifndef NOMCX		 
#include <mcx.h>	 
#endif /* NOMCX */	 

#ifndef NOIME		  
#include <imm.h>		
#endif
#endif /* WINVER >= 0x0400 */
#endif

#ifndef RC_INVOKED
#if	 ( _MSC_VER >= 800 )
#pragma warning(default:4001)
#pragma warning(default:4201)
#pragma warning(default:4214)
/* Leave 4514 disabled. It's a stupid warning anyway. */
#endif
#endif /* RC_INVOKED */

#endif /* RC_INVOKED */

#endif /* _INC_WINDOWS */
#endif /* _WINDOWS_ */

А вот из DevTools\VS2003\Vc7\PlatformSDK\Include\Windows.h

Код:
/*++ BUILD Version: 0001	Increment this if a change has global effects

Copyright (c) Microsoft Corporation. All rights reserved.

Module Name:


windows.h

Abstract:

Master include file for Windows applications.

--*/

#ifndef _WINDOWS_
#define _WINDOWS_


#ifndef WINVER
#define WINVER 0x0501
#else
#if defined(_WIN32_WINNT) && (WINVER < 0x0400) && (_WIN32_WINNT > 0x0400)
#error WINVER setting conflicts with _WIN32_WINNT setting
#endif
#endif

#ifndef _INC_WINDOWS
#define _INC_WINDOWS

#if defined (_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

/* If defined, the following flags inhibit definition
*	 of the indicated items.
*
* NOGDICAPMASKS	 - CC_*, LC_*, PC_*, CP_*, TC_*, RC_
* NOVIRTUALKEYCODES - VK_*
* NOWINMESSAGES	 - WM_*, EM_*, LB_*, CB_*
* NOWINSTYLES	  - WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
* NOSYSMETRICS	 - SM_*
* NOMENUS		  - MF_*
* NOICONS		  - IDI_*
* NOKEYSTATES	  - MK_*
* NOSYSCOMMANDS	 - SC_*
* NORASTEROPS	  - Binary and Tertiary raster ops
* NOSHOWWINDOW	 - SW_*
* OEMRESOURCE	  - OEM Resource values
* NOATOM			- Atom Manager routines
* NOCLIPBOARD	  - Clipboard routines
* NOCOLOR		  - Screen colors
* NOCTLMGR		 - Control and Dialog routines
* NODRAWTEXT		- DrawText() and DT_*
* NOGDI			 - All GDI defines and routines
* NOKERNEL		 - All KERNEL defines and routines
* NOUSER			- All USER defines and routines
* NONLS			 - All NLS defines and routines
* NOMB			 - MB_* and MessageBox()
* NOMEMMGR		 - GMEM_*, LMEM_*, GHND, LHND, associated routines
* NOMETAFILE		- typedef METAFILEPICT
* NOMINMAX		 - Macros min(a,b) and max(a,b)
* NOMSG			 - typedef MSG and associated routines
* NOOPENFILE		- OpenFile(), OemToAnsi, AnsiToOem, and OF_*
* NOSCROLL		 - SB_* and scrolling routines
* NOSERVICE		 - All Service Controller routines, SERVICE_ equates, etc.
* NOSOUND		  - Sound driver routines
* NOTEXTMETRIC	 - typedef TEXTMETRIC and associated routines
* NOWH			 - SetWindowsHook and WH_*
* NOWINOFFSETS	 - GWL_*, GCL_*, associated routines
* NOCOMM			- COMM driver routines
* NOKANJI		  - Kanji support stuff.
* NOHELP			- Help engine interface.
* NOPROFILER		- Profiler interface.
* NODEFERWINDOWPOS - DeferWindowPos routines
* NOMCX			 - Modem Configuration Extensions
*/

#if defined(RC_INVOKED) && !defined(NOWINRES)

#include <winresrc.h>

#else

#if defined(RC_INVOKED)
/* Turn off a bunch of stuff to ensure that RC files compile OK. */
#define NOATOM
#define NOGDI
#define NOGDICAPMASKS
#define NOMETAFILE
#define NOMINMAX
#define NOMSG
#define NOOPENFILE
#define NORASTEROPS
#define NOSCROLL
#define NOSOUND
#define NOSYSMETRICS
#define NOTEXTMETRIC
#define NOWH
#define NOCOMM
#define NOKANJI
#define NOCRYPT
#define NOMCX
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_IX86)
#define _X86_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_AMD64)
#define _AMD64_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_M68K)
#define _68K_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_MPPC)
#define _MPPC_
#endif

#if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_M_IX86) && !defined(_AMD64_) && defined(_M_IA64)
#if !defined(_IA64_)
#define _IA64_
#endif // !_IA64_
#endif

#ifndef _MAC
#if defined(_68K_) || defined(_MPPC_)
#define _MAC
#endif
#endif

#if defined (_MSC_VER)
#if ( _MSC_VER >= 800 )
#ifndef __cplusplus
#pragma warning(disable:4116)	  // TYPE_ALIGNMENT generates this - move it
// outside the warning push/pop scope.
#endif
#endif
#endif

#ifndef RC_INVOKED
#if	 ( _MSC_VER >= 800 )
#pragma warning(disable:4514)
#ifndef __WINDOWS_DONT_DISABLE_PRAGMA_PACK_WARNING__
#pragma warning(disable:4103)
#endif
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning(disable:4001)
#pragma warning(disable:4201)
#pragma warning(disable:4214)
#endif
#include <excpt.h>
#include <stdarg.h>
#endif /* RC_INVOKED */

#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#if !defined(_MAC) || defined(_WIN32NLS)
#include <winnls.h>
#endif
#ifndef _MAC
#include <wincon.h>
#include <winver.h>
#endif
#if !defined(_MAC) || defined(_WIN32REG)
#include <winreg.h>
#endif
#ifndef _MAC
#include <winnetwk.h>
#endif

#ifndef WIN32_LEAN_AND_MEAN
#include <cderr.h>
#include <dde.h>
#include <ddeml.h>
#include <dlgs.h>
#ifndef _MAC
#include <lzexpand.h>
#include <mmsystem.h>
#include <nb30.h>
#include <rpc.h>
#endif
#include <shellapi.h>
#ifndef _MAC
#include <winperf.h>
#include <winsock.h>
#endif
#ifndef NOCRYPT
#include <wincrypt.h>
#include <winefs.h>
#include <winscard.h>
#endif

#ifndef NOGDI
#ifndef _MAC
#include <winspool.h>
#ifdef INC_OLE1
#include <ole.h>
#else
#include <ole2.h>
#endif /* !INC_OLE1 */
#endif /* !MAC */
#include <commdlg.h>
#endif /* !NOGDI */
#endif /* WIN32_LEAN_AND_MEAN */

#include <stralign.h>

#ifdef _MAC
#include <winwlm.h>
#endif


#ifdef INC_OLE2
#include <ole2.h>
#endif /* INC_OLE2 */

#ifndef _MAC
#ifndef NOSERVICE
#include <winsvc.h>
#endif

#if(WINVER >= 0x0400)
#ifndef NOMCX
#include <mcx.h>
#endif /* NOMCX */

#ifndef NOIME
#include <imm.h>
#endif
#endif /* WINVER >= 0x0400 */
#endif

#ifndef RC_INVOKED
#if	 ( _MSC_VER >= 800 )
#if _MSC_VER >= 1200
#pragma warning(pop)
#else
#pragma warning(default:4001)
#pragma warning(default:4201)
#pragma warning(default:4214)
/* Leave 4514 disabled. It's an unneeded warning anyway. */
#endif
#endif
#endif /* RC_INVOKED */

#endif /* RC_INVOKED */

#endif /* _INC_WINDOWS */
#endif /* _WINDOWS_ */
 
Y

Y@M@SUBi

Не работаєт!
error C2664: 'CharToOemW' : cannot convert parameter 1 from 'const char *' to 'LPCWSTR' :ph34r:
 
E

European

Код покажи, а то сейчас запой по фотографии лечить начнем
 
Y

Y@M@SUBi

# include <iostream>
#include <windows.h>
using namespace std;

char* Rus(const char *text);

int main()
{
cout<<Rus("Тест")<<endl;
return 0;
}
char *Rus(const char *text)
{char bufRus[256];
CharToOem(text, bufRus);
return bufRus;
}
 
E

European

Отключи в свойствах проекта использование Unicode

General -> Character Set = Use Multi-Byte Character Set
 
Y

Y@M@SUBi

╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠
╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╚JW►☺╠╠╠╠╠╠╠╠╠╠╠ ╠╠╠╠╠╠╠╠ь ╠╠╠
Для продолжения нажмите любую клавишу . . . :ph34r:

# include <iostream>
#include <windows.h>
using namespace std;

char* Rus(const char *text);

int main()
{
cout<<Rus("Тест")<<endl;
return 0;
}
char bufRus[256];
char *Rus(const char *text)
{char bufRus[256]; !!!
CharToOem(text, bufRus);
return bufRus;
}
European - уоu the best! моя училка даже не могла зделать
 
E

European

Ты из функции Rus возвращаешь указатель на разрушенный объект. Ничего удивительного :ph34r: [m7]Zeitgeist давал рабочий вариант
 
Y

Y@M@SUBi

Ты из функции Rus возвращаешь указатель на разрушенный объект. Ничего удивительного :ph34r: [m7]Zeitgeist давал рабочий вариант

[m7]Zeitgeist 1:10:2006, 00:53
Код

#include <windows.h>
#include <iostream>
....
//описваем ф-цию

char* Rus(const char* text);
......
//ф-ция main

.....
void main()
{
cout<<Rus("Тест")<<endl;
{ <---------------------------------------------------------- тут ошибка!

char bufRus[256];

char* Rus(const char* text)
{
CharToOem(text, bufRus);
return bufRus;
}
 
I

Izverg

Правильный вариант русскоязычного текста в консоли:
Код:
#include <stdio.h>
#include <locale.h>

void main()
{
setlocale(LC_ALL,"rus");
printf("Привет мир!\n");
}
 
Статус
Закрыто для дальнейших ответов.
Мы в соцсетях:

Обучение наступательной кибербезопасности в игровой форме. Начать игру!