医学影像与核医学考研:关于C++.NET的问题,
来源:百度文库 编辑:高校问答 时间:2024/04/28 06:12:09
如果你会C#,学.NET Console应该比较快。否则还是老老实实用win32 Console吧。
下面是三个版本的Hello world,自己比较比较:
//win32 Console
// hello.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
std::cout<<"hello world"<<std::endl;
return 0;
}
//或者
#include "stdafx.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout<<"hello world"<<endl;
return 0;
}
//C#
using System;
namespace Hello
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
Console.WriteLine("hello world");
//
}
}
}
//.NET Console Application
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
int _tmain()
{
Console::WriteLine(S"Hello World");
return 0;
}
include<stdio.h>
void main()
......
printf("唉 我也是初学 不会 只是帮你捧场而已");
......