vs2008制作,代码没有问题,为什么运行不出来啊?

\u600e\u4e48\u5728VS2008\u91cc\u7f16\u5199C\u8bed\u8a00\u7a0b\u5e8f

_tmain \u5c31\u662f\u73b0\u5728\u7684\u5165\u53e3\u51fd\u6570\u5566\uff0c\u8fd4\u56de\u503c\u9ed8\u8ba4\u53d8\u6210\u4e86int\uff0c\u8fd9\u4e0d\u91cd\u8981\uff0c\u8fd4\u56de\u7684\u5c31\u662f\u9000\u51fa\u4ee3\u7801\u4e86
\u4e4b\u6240\u4ee5 \u591a\u4e86_t \u662f\u56e0\u4e3a\u9ed8\u8ba4\u4f7f\u7528\u4e86unicode\u5bbd\u5b57\u7b26\u96c6\uff0c \u4e0d\u50cf\u4ee5\u524d\u90a3\u6837\u9ed8\u8ba4\u662fasc\u5b57\u7b26\u96c6\uff0c unicode\u5b57\u7b26\u96c6\u597d\u5904\u975e\u5e38\u660e\u663e\uff0c\u5728\u4e0d\u540c\u8bed\u8a00\u7684\u7cfb\u7edf\u4e0b\u4e0d\u4f1a\u4e71\u7801
\uff0c\u5982\u4eca\u5199\u7a0b\u5e8f\u4e5f\u662f\u6781\u529b\u63a8\u8350\u4f7f\u7528unicode\u7684\uff0c\u540c\u65f6ascII\u4e0eunicode\u5904\u7406\u5b57\u7b26\u7a9c\u65f6\u6240\u7528\u7684\u51fd\u6570\u90fd\u4e0d\u540c\uff0c\u591a\u770b\u6559\u7a0b\u5427\uff0c\u7f16\u8bd1\u8bbe\u7f6e\u4e2d\u6709 \u5b57\u7b26\u96c6\u7684\u8bbe\u7f6e\uff0c\u60f3\u6539\u53ef\u4ee5\u6539\u56de\u6765


\u81f3\u4e8e\u65b0\u72482008\u7684\u6559\u7a0b\u771f\u7684\u4e0d\u597d\u627e\uff0c\u5927\u591a\u4e66\u4e5f\u6ca1\u6709\u8bb2unicode\u7684\u4e8b\u60c5\uff0c
\u6240\u4ee5\u770b\u662f\u770b\u7ecf\u5178\u7c7b\u7684\u4e66\u7c4d\u5427\uff0c\u6211\u4e5f\u662f\u56e0\u4e3a\u5982\u6b64\uff0c\u5373\u88c5\u4e86VC6.0 \uff0c\u53c8\u88c5\u4e862008\uff0c\u4e3b\u5b66\u7684\u662fC#\u4e86

\u7535\u9a74\u627e\u4e86\u4e0b\uff0c\u8fd9\u4e2a\u6559\u7a0b\u5e94\u8be5\u4e0d\u9519\uff0c\u8981\u597d\u597d\u5b66\u4e60\u8fd8\u662f\u76f4\u63a5\u4e70\u672c\u597d\u4e66\u53bb\u5427
http://www.verycd.com/topics/2773169/





The Application Wizard has generated the stdafx.h header file as part of the project, and if you take a
look at the code in there, you\u2019ll see there are two further #include directives for standard library header
files stdio.h and tchar.h. The old-style header stdio.h is for standard I/O and was used before the cur-
rent ISO/ANSI standard for C++; this covers the same functionality as the header. tchar.h
is a Microsoft-specific header file defining text functions. The idea is that stdafx.h should define a set of
standard system include files for your project\u2014you would add #include directives for any other sys-
temheaders that you need in this file. While you are learning ISO/ANSI C++, you won\u2019t be using either
of the headers that appear in stdafx.h, which is one reason for not using the default file generation
capability provided by the Application Wizard

\u8fd9\u4e00\u6bb5\u8f7d\u81ea\u67d0\u4e66\uff0c\u8868\u793a\u5728stdafx.h\u4e2d\u6709tchar\u4e5f\u5c31\u662f\u5bbd\u5b57\u7b26\u96c6\u5b9a\u4e49\u7684\u5934\u6587\u4ef6tchar.h\u7684\u5305\u542b\uff0c\u5982\u679c\u4f60\u4e0d\u9700\u8981\uff0c\u5219\u53bb\u6389\u8fd9\u4e2a\u5305\u542b\uff0c \u53bb\u6389_t
\u76ee\u524d\u7f51\u4e0a\u80fd\u627e\u5230\u7684VC++2008\u7684\u4e66\u90fd\u662f\u82f1\u6587\u7684\u3002\u3002\u3002\u3002

#include
using namespace std;
int length(char *p);//\u51fd\u6570\u58f0\u660e
int main()
{
int len;
char str[100];//\u5b9a\u4e49100\u4e2achar\u91cf\uff0c\u800c\u4e0d\u662f100\u4e2a\u6307\u5411char\u91cf\u7684\u6307\u9488
gets(str);//gets(str)\u53d6\u5f97\u662fstr[100]\u7684\u9996\u5730\u5740str
len=length(str);
printf("the string has %d characters.",len);
system("pause");
return 0;
}
int length(char *p)
{
int n=0;
while(*p!='\0')
{
n++;
p++;
}
return n;
}

运行提示错误的对话框,就是要装一个补丁,微软有下载的。
如果没有任何提示没有任何反应的话,那就是你程序运行完后自动退出,闪了一下你没看到。可以在程序最后加一个 getchar(); 来停住程序

  • 鎬庝箞鍦VS2008閲岀紪鍐機璇█绋嬪簭
    绛旓細锛屽浠婂啓绋嬪簭涔熸槸鏋佸姏鎺ㄨ崘浣跨敤unicode鐨勶紝鍚屾椂ascII涓巙nicode澶勭悊瀛楃绐滄椂鎵鐢ㄧ殑鍑芥暟閮戒笉鍚岋紝澶氱湅鏁欑▼鍚э紝缂栬瘧璁剧疆涓湁 瀛楃闆嗙殑璁剧疆锛屾兂鏀瑰彲浠ユ敼鍥炴潵 鑷充簬鏂扮増2008鐨勬暀绋嬬湡鐨勪笉濂芥壘锛屽ぇ澶氫功涔娌℃湁璁瞮nicode鐨勪簨鎯咃紝鎵浠ョ湅鏄湅缁忓吀绫荤殑涔︾睄鍚э紝鎴戜篃鏄洜涓哄姝わ紝鍗宠浜哣C6.0 锛屽張瑁呬簡2008锛涓诲鐨勬槸C#...
  • vs2008寮濮嬭缃殑鐢╟#鐜,鐜板湪鍐檆++鐨浠g爜娌℃湁鏅鸿兘鎻愮ず浜,鎬庝箞鍔?
    绛旓細宸ュ叿鈫掑鍏ュ鍑鸿缃啋閲嶇疆鎵鏈夎缃
  • 杩欐槸鍦VS2008閬囧埌鐨闂,甯屾湜鏈夊績浜鸿В鍐充竴涓
    绛旓細浣犵殑浠g爜閲岄潰娌℃湁please input a number:杩欎釜鎵撳嵃銆傝鏄庝綘杩愯鐨 鍜屼綘涓婁紶鐨勪笉鏄竴涓唬鐮併傚彲浠ュ叧闂墍鏈夊伐绋嬪悗锛 閲嶆柊鎵撳紑浣犻渶瑕佺殑銆傚彟澶 浣犵殑浠g爜寤鸿淇敼涓 include "stdafx.h"#include "stdio.h"int _tmain(int argc, _TCHAR* argv[]){ int x,y; scanf("%d",&x); if(x<1)...
  • 涓嬮潰鏄垜鍦vs2008涓婄紪鍐欑殑浠g爜,涓轰粈涔堢粨鏋滀竴闂岃繃涓嶅仠鍛
    绛旓細ctrl+F5
  • c++: vs2008閲岄潰浠g爜鍑虹幇濡備笅鐘跺喌,姹傞珮鎵嬬浉鍔,璋㈣阿!
    绛旓細浣犺瘯璇曟垜鏀圭殑锛孷s2008 娌℃祴璇 include <string> include <fstream> include <iostream> include <vector> using namespace std;int main(){ vector<string> sv;sv.push_back("aaa");sv.push_back("bbb");sv.push_back("ccc");sv.push_back("ddd");sv.push_back("eee");vector<string>...
  • 鎴戠敤vs2008缂栫▼鏈夋椂鍊欏姩鍔ㄥ氨鍗℃浜,鏈鏃跺欏湪婧愪唬鐮閲岄潰閫変竴娈典唬鐮佺敤...
    绛旓細灏濊瘯鏇存柊office锛屼箣鍚庨噸鍚數鑴戙(3)鍋囧杩樹笉琛岋紝灏濊瘯瀵笴:\Program Files\Common Files\Microsoft Shared\OFFICE12\Office Setup Controller\setup.exe鏂囦欢杩涜鍒犻櫎鎴栭噸鍛藉悕銆備互涓婁究鏄垜瀵vs2008璁捐瑙嗗浘鍋囨鍘熷洜鍙婅В鍐虫柟妗堢殑鎬荤粨锛屽亣濡備綘鏈夌被浼闂鍙互浠庢柟妗堜竴鍒颁笁渚濇鎺掗櫎锛屽簲璇ヨ兘澶熻В鍐炽
  • vs2008閲宷t娌′唬鐮鎻愮ず鎬庝箞瑙e喅
    绛旓細vs鐨勪换鍔℃爮 AssistX -> visual Assist X Options -> projects -> C/C++ Directories 閫 custom 鍜 stable include files锛岀劧鍚庢妸qt鐨刬nclude鐩綍鍔犺繘鍘伙紝渚嬪鎴戠殑鏄繖鏍凤細鐐瑰嚮纭畾鍚庯紝閲嶅惎vs锛閲嶅惎鐨勬椂鍊欒瀵焩s鐨勫乏涓嬭锛屼細鍦ㄦ壂鎻忎竴浜涚洰褰曪紝璇存槑姝e湪寰閲屽姞澶存枃浠 ...
  • 浣犲ソ,鍚戜綘璇㈤棶涓涓VS2008鐨勭紪璇戣繛鎺闂
    绛旓細绗竴涓棶棰橈細缂栬瘧鎸夐挳寮忎竴涓笁瑙掑舰鐨勭豢鐨勪笢瑗 绗簩涓棶棰橈細.h涓嶈鐢ㄤ簡锛屽洜涓虹幇鍦ㄧ敤using namespace std;杩欏彞璇濓紝杩欏彞璇濈殑鎰忔濇槸鍖呮嫭涓婇潰include鎵鍚殑鍚嶇О绌洪棿銆傜涓変釜闂锛氬叾瀹炶繖涓棶棰樹笌绗簩涓棶棰樻湁鍏筹紝涔熸槸鍛藉悕绌洪棿闂锛鍦ㄤ綘鐨勮繖涓▼搴忎腑鍙互鐢╱sing std::cout杩欏彞璇濅唬鏇縰sing namespace std...
  • VS2008鎬庝箞鐢?
    绛旓細VS2008鎬庝箞鐢ㄩ樋,娣诲姞椤规湁浠涔堜綔鐢ㄤ箞?鎬庝箞鎶婄紪濂界殑婧愪唬鐮鏀捐繘鍘,鎬庝箞璋冭瘯鎬庝箞杩愯?銆傘傘傜涓娆$敤杩欎釜銆傘傚穿婧冧腑銆傘傚湪椤圭殑婧愭枃浠堕噷娣诲姞浜嗚缂栧啓鐨浠g爜,鐒跺悗璋冭瘯,鎬诲嚭鐜版棤娉曞惎鍔... VS2008鎬庝箞鐢ㄩ樋,娣诲姞椤规湁浠涔堜綔鐢ㄤ箞?鎬庝箞鎶婄紪濂界殑婧愪唬鐮佹斁杩涘幓,鎬庝箞璋冭瘯鎬庝箞杩愯?銆傘傘傜涓娆$敤杩欎釜銆傘傚穿婧冧腑銆傘傚湪椤圭殑...
  • 鐢Vs2008缂栧啓C璇█鐨闂銆傘
    绛旓細鍏充簬VS2008杩愯CLR鈥擶indows绐椾綋搴旂敤绋嬪簭鐨勬椂鍊 error PRJ0003 : 鐢熸垚 cmd.exe 鏃跺嚭閿 solution:tools=> Options => Projects and Solutions -> VC++ Directories page then place below rows:(SystemRoot)\System32 (SystemRoot)(SystemRoot)\System32\wbem 杩介棶涓涓 鎴戝啀鎶婂浘鐗囩粰涓婃潵 瑕佷笉鐒朵竴涓婂浘 ...
  • 扩展阅读:恶搞编程代码可复制 ... 数控m99循环5次怎么编 ... 新手怎么学代码编程 ... vs怎么开始写代码 ... microsoft vi2008 ... 法兰克报警代码2008 ... 程序代码 ... 怎么写代码 ... 代码编程 ...

    本站交流只代表网友个人观点,与本站立场无关
    欢迎反馈与建议,请联系电邮
    2024© 车视网