testcpp.cpp

本文通过一个简单的示例程序展示了C语言与C++语言在编译过程中的区别。程序使用预处理指令来判断编译环境,并分别输出C或C++的编译信息。

  name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-5572165936844014&dt=1194442938015&lmt=1194190197&format=336x280_as&output=html&correlator=1194442937843&url=file%3A%2F%2F%2FC%3A%2FDocuments%2520and%2520Settings%2Flhh1%2F%E6%A1%8C%E9%9D%A2%2FCLanguage.htm&color_bg=FFFFFF&color_text=000000&color_link=000000&color_url=FFFFFF&color_border=FFFFFF&ad_type=text&ga_vid=583001034.1194442938&ga_sid=1194442938&ga_hid=1942779085&flash=9&u_h=768&u_w=1024&u_ah=740&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="336" scrolling="no" height="280" allowtransparency="allowtransparency"> #ifdef __cplusplus
#include <iostream.h>
#else
#include <stdio.h>
#endif


void main(void)
 {
#ifdef __cplusplus
  cout << "C++ compilation";
#else
  printf("C compilation/n");
#endif
 }

python setup.py build_ext --inplace running build_ext building 'simple_add' extension creating build creating build\temp.win32-cpython-311 creating build\temp.win32-cpython-311\Release D:\workSoftware\vs2022\VC\Tools\MSVC\14.44.35207\bin\HostX86\x86\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -ID:\workSoftware\python32\include -ID:\workSoftware\python32\Include -ID:\workSoftware\vs2022\VC\Tools\MSVC\14.44.35207\include -ID:\workSoftware\vs2022\VC\Tools\MSVC\14.44.35207\ATLMFC\include -ID:\workSoftware\vs2022\VC\Auxiliary\VS\include "-ID:\Windows Kits\10\include\10.0.26100.0\ucrt" "-ID:\Windows Kits\10\\include\10.0.26100.0\\um" "-ID:\Windows Kits\10\\include\10.0.26100.0\\shared" "-ID:\Windows Kits\10\\include\10.0.26100.0\\winrt" "-ID:\Windows Kits\10\\include\10.0.26100.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tptest.cpp /Fobuild\temp.win32-cpython-311\Release\test.obj test.cpp test.cpp(1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 creating C:\Users\limingji\Desktop\testcpp\build\lib.win32-cpython-311 D:\workSoftware\vs2022\VC\Tools\MSVC\14.44.35207\bin\HostX86\x86\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\workSoftware\python32\libs /LIBPATH:D:\workSoftware\python32 /LIBPATH:D:\workSoftware\python32\PCbuild\win32 /LIBPATH:D:\workSoftware\vs2022\VC\Tools\MSVC\14.44.35207\ATLMFC\lib\x86 /LIBPATH:D:\workSoftware\vs2022\VC\Tools\MSVC\14.44.35207\lib\x86 "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86" "/LIBPATH:D:\Windows Kits\10\lib\10.0.26100.0\ucrt\x86" "/LIBPATH:D:\Windows Kits\10\\lib\10.0.26100.0\\um\x86" /EXPORT:PyInit_simple_add build\temp.win32-cpython-311\Release\test.obj /OUT:build\lib.win32-cpython-311\simple_add.cp311-win32.pyd /IMPLIB:build\temp.win32-cpython-311\Release\simple_add.cp311-win32.lib 正在创建库 build\temp.win32-cpython-311\Release\simple_add.cp311-win32.lib 和对象 build\temp.win32-cpython-311\Release\simple_add.cp311-win32.exp 正在生成代码 已完成代码的生成 copying build\lib.win32-cpython-311\simple_add.cp311-win32.pyd ->
最新发布
11-17
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值