解决windows.h函数中无cin、cout的困难
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了解决windows.h函数中无cin、cout的困难,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2775字,纯文字阅读大概需要4分钟。
内容图文
有时候写坑人代码的时候windows.h函数总是没有cin和cout以及一些运算函数,要自己再打一遍其他函数,这就显得十分麻烦,于是就得使用我以下的方法来操作。
第一步 打开windows.h函数
这个简单,按住ctrl,用鼠标点击就行了。
第二步 修改代码
改成下面的就行了:
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _WINDOWS_
#define _WINDOWS_
#include <_mingw.h>
#include <sdkddkver.h>
/* Some kludge for Obj-C.
For Obj-C the 'interface' is a keyword, but interface is used
in midl-code too. To resolve this conflict for at least the
main windows API header, we define it here temporary. */
#ifdef __OBJC__
#pragma push_macro("interface")
#undef interface
#define interface struct
#endif
#ifndef _INC_WINDOWS
#define _INC_WINDOWS
#if defined(RC_INVOKED) && !defined(NOWINRES)
#include <winresrc.h>
#else
#ifdef RC_INVOKED
#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(__x86_64) && !(defined(_X86_) || defined(__i386__) || defined(_IA64_))
#if !defined(_AMD64_)
#define _AMD64_
#endif
#endif /* _AMD64_ */
#if defined(__ia64__) && !(defined(_X86_) || defined(__x86_64) || defined(_AMD64_))
#if !defined(_IA64_)
#define _IA64_
#endif
#endif /* _IA64_ */
#ifndef RC_INVOKED
#include <excpt.h>
#include <stdarg.h>
#endif
#include <bits/stdc++.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#include <winnls.h>
#include <wincon.h>
#include <winver.h>
#include <winreg.h>
#include <winnetwk.h>
#include <virtdisk.h>
#ifndef WIN32_LEAN_AND_MEAN
#include <cderr.h>
#include <dde.h>
#include <ddeml.h>
#include <dlgs.h>
#include <lzexpand.h>
#include <mmsystem.h>
#include <nb30.h>
#include <rpc.h>
#include <shellapi.h>
#include <winperf.h>
#if defined(__USE_W32_SOCKETS) || !defined(__CYGWIN__)
#include <winsock.h>
#endif
#ifndef NOCRYPT
#include <wincrypt.h>
#include <winefs.h>
#include <winscard.h>
#endif
#ifndef NOUSER
#ifndef NOGDI
#include <winspool.h>
#ifdef INC_OLE1
#include <ole.h>
#else
#include <ole2.h>
#endif
#include <commdlg.h>
#endif
#endif
#endif
#ifndef __CYGWIN__
#include <stralign.h>
#endif
#ifdef INC_OLE2
#include <ole2.h>
#endif
#ifndef NOSERVICE
#include <winsvc.h>
#endif
#ifndef NOMCX
#include <mcx.h>
#endif
#ifndef NOIME
#include <imm.h>
#endif
#endif
#endif
/* Restore old value of interface for Obj-C. See above. */
#ifdef __OBJC__
#pragma pop_macro("interface")
#endif
#endif
就讲到这里,自己去试试吧,这样烦恼就解决了
内容总结
以上是互联网集市为您收集整理的解决windows.h函数中无cin、cout的困难全部内容,希望文章能够帮你解决解决windows.h函数中无cin、cout的困难所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。