
2008年10月23日
Visual C++ 插件系列介紹
說到Visual C++的插件,大家可能只有想到Visual Assist吧。天真!行內開發的插件可只有這個!?下面介紹一下vc6.0的其他插件。
Visual Assist(強烈推薦)
網址:http://www.wholetomato.com/
功能:VA從5.0一直到現在的VAX,功能越來越強大,除了以前版本中的自動識別各種關鍵字,系統函數,成員變量,自動給出輸入提示,自動更正大小寫錯誤,自動標示錯誤等等以外,最新的版本中還在WorkSpace窗口中加入一個VA View,可以更方便的查找工程中的文件、類和變量。
WndTabs(強烈推薦)
網址:http://www.wndtabs.com/
功能:WndTabs主要是在編輯窗口中顯示了所有已經打開的文件,在VC中能夠更方便的操作這些文件,比如修改文件屬性,copy文件路徑、文件名等,并且還開放源代碼,你要是愿意的話,可以添加自己很興趣的功能。
LineCounter
網址: http://www.wndtabs.com/
功能:用來統計整個工程的代碼行數,包括總行數、代碼行數、注釋行數、空行數等,并且對多個工程一起統計時,不會把相同的文件計算多次.
Spelly
網址:http://www.wndtabs.com/
功能:一個拼寫檢查的插件,可以對整個文件或所選部分進行拼寫檢查,支持C/C++/C#, VB, Fortran 和HTML。
SourceStyler C++
網址:http://www.sourcestyler.com/
功能:此插件是針對C++的一個格式化工具,可以針對自己的編碼習慣,選擇一種編碼風格,也可以自己定義,而且定義非常詳細,有表達式、指針、模板、類、枚舉等十幾種,肯定能滿足你的需要。
Numega BoundsChecker(強烈推薦)
功能:是針對Visual C++6.0應用程序的最為全面的錯誤檢測工具。BoundsChecker 能自動指出靜態,堆棧內存錯誤和資源泄漏問題。BoundsChecker 能夠校驗最新的 Windows APIs,包括 ActiveX, DirectX, OLE/COM, ODBC等等。能夠發現與 Windows 平臺兼容性。
BCGControlBar Library
功能:非常好的一套應用于vc6的界面擴展類庫,輕松的作出 vc2003 的界面。并且給了各種界面例子,如vc.net、outlook、更換皮膚等等。
Comment Wizard
網址:http://www.shnenglu.com/fwxjj/
功能:Visual C++插件,提供了Visual C++源代碼注解標準化與自動化功能。在它的幫助下,您可快速創建標頭文件信息注解,文件中模塊注解, C++處理方式,以及C語言功能與歷史校正功能注解,等等。
String watch Microsoft Visual Studio add-in
網址:http://www.codeguru.com/cpp/v-s/devstudio_macros/debugging/article.php/c5989
功能:調試時查看字符串的。
Tabbar插件
網址:http://www.winmsg.com/cn/tabbar.htm
功能:顯示多tab的插件
轉載自:http://bbs.xgcollege.com/read.php?tid-1138.html
posted @
2008-10-23 22:37 longhr 閱讀(4249) |
評論 (1) |
編輯 收藏

/**//************************************************************************/

/**//* 輸出常用的ASCII碼表 */

/**//************************************************************************/
#include "iostream.h"
int main()


{
for (int i=32;i<=127;i++)

{
cout<<(char)i; //強制類型轉換
}
return 0;
}


美化一些的版本,這樣看起來輸出更好看一些
#include "iostream.h"
#include "iomanip.h"//為了使用setw()
int main()


{
char temp;
for (int i=32;i<=127;i++)

{
temp = i;
cout<<setw(2)<<temp; //setw(n) 設域寬為n個字符
if (i%16==15)

{
cout<<endl;
}
}
return 0;
}
輸出的結果如下
! " # $ % & ' ( ) * + , - . /
0 1 2 3 4 5 6 7 8 9 : ; < = > ?
@ A B C D E F G H I J K L M N O
P Q R S T U V W X Y Z [ \ ] ^ _
` a b c d e f g h i j k l m n o
p q r s t u v w x y z { | } ~
Press any key to continue
posted @
2008-10-23 21:11 longhr 閱讀(801) |
評論 (0) |
編輯 收藏
一直對于遞歸的使用不太了解,這樣寫出一個最簡單的算法,這樣就可以知道怎么具體使用了。把公式套進去就可以了。
#include "iostream.h"

/**//************************************************************************/

/**//* 使用遞歸最簡單的程序,實現f(n)=2*f(n)+3 */

/**//************************************************************************/
int f(int i);
int main()


{
for (int i=1;i<=8;i++)

{
cout<<"f"<<"("<<i<<")"<<"="<<f(i)<<endl;
}
return 0;
}

int f(int i)


{
if (i ==1)

{
return 1;
}
else

{
return 2*f(i-1)+3;
}
}
posted @
2008-10-23 20:57 longhr 閱讀(674) |
評論 (0) |
編輯 收藏
能被4整除是閏年,但是特殊情況是整百年要被400整除才行
#include "iostream.h"

int main()


{
int year;
cin>>year;
if (year%4 ==0 && year%100!=0 || year%400 ==0)

{
cout<<"是閏年(leapyear)";
}
else

{
cout<<"不是閏年";
}
return 0;
}
posted @
2008-10-23 17:21 longhr 閱讀(1409) |
評論 (3) |
編輯 收藏
類似這樣的三角形
*******
******
*****
****
***
**
*
#include "iostream.h"
int main()


{
for (int i=7;i>0;i--)

{
int p=i;
while (p--)

{
cout<<"*";
}
cout<<"\n";
}
return 0;
}
輸出這樣的三角形類似
*
**
***
****
*****
#include "iostream.h"
int main()


{
for (int i=1;i<=5;i++)

{
int p=i;
while (p--)

{
cout<<"*";
}
cout<<"\n";
}
return 0;
}
類似這樣的等腰三角形
*
**
***
****
*****
******
*******
********
*********
**********
#include "iostream.h"
int main()


{
int sum = 10;
for (int i=1;i<=sum;i++)

{
int p=(sum -i)/2;
while (p--)

{
cout<<" ";
}
p=i;
while (p--)

{
cout<<"*";
}
cout<<"\n";
}
return 0;
}
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * * * *
* * * * * * * * * *
#include "iostream.h"
int main()


{
int sum = 10;
for (int i=sum;i>=0;i--)

{
int p=i;
while (p--)

{
cout<<" ";
}
p=sum -i;
while (p--)

{
cout<<"* ";
}
cout<<"\n";
}
return 0;
}
posted @
2008-10-23 16:37 longhr 閱讀(1555) |
評論 (0) |
編輯 收藏
采用指針的方法
#include <stdio.h>
#include "iostream"
#include <string.h>
int main()


{
char *src = "hello";
int len= strlen(src);
char *dest = (char *)malloc(len+1);
char *d= dest;
char *s = &src[len-1];
len = 1;
while (len--)

{
*d++=*s--;
}
*d = 0; //否則會亂碼
printf("%s\n",dest);
free(dest);
return 0;
}
采用數組的方法
#include <stdio.h>
#include "iostream"
#include <string.h>
int main()


{
char src[] = "hello";
int len = strlen(src);
char temp;
for (int i=0;i<len/2;i++)

{
temp = src[i];
src[i] = src[len-i-1];
src[len-i-1] = temp;
}
printf("%s\n",src);
return 0;
}

參考的代碼

int main()
{
char* src = "hello,world";
int len = strlen(src);
char* dest = (char*)malloc(len+1);//要為\0分配一個空間
char* d = dest;
char* s = &src[len-1];//指向最后一個字符
while( len-- != 0 )
*d++=*s--;
*d = 0;//尾部要加\0
printf("%s\n",dest);
free(dest);// 使用完,應當釋放空間,以免造成內存匯泄露
return 0;
}

#include <stdio.h>
#include <string.h>
main()


{
char str[]="hello,world";
int len=strlen(str);
char t;
for(int i=0; i<len/2; i++)


{
t=str[i];
str[i]=str[len-i-1]; str[len-i-1]=t;
}
printf("%s",str);
return 0;
}

posted @
2008-10-23 16:05 longhr 閱讀(4231) |
評論 (0) |
編輯 收藏