C/C++ ³£¼ûÎóÇø
C/C++ ³£¼ûÎóÇø
1. C++ËäÈ»Ö÷ÒªÊÇÒÔCµÄ»ù´¡·¢Õ¹ÆðÀ´µÄÒ»ÃÅÐÂÓïÑÔ£¬µ«Ëý²»ÊÇCµÄÌæ´úÆ·£¬²»ÊÇCµÄÉý¼¶£¬C++ºÍCÊÇÐֵܹØϵ¡£Ã»ÓÐ˱ÈËÏȽøµÄ˵·¨£¬¸üÖØÒªµÄÒ»µãÊÇCºÍC++¸÷×Եıê׼ίԱ»áÊǶÀÁ¢µÄ£¬×îеÄC++±ê×¼ÊÇC++98£¬×îеÄC±ê×¼ÊÇC99¡£Òò´ËҲûÓÐÏÈѧCÔÙ˵C++µÄ˵·¨£¬Ò²²»ÔÙ£¨×¢ÒâÕâ¸ö"²»ÔÙ"£©ÓÐC++Óï·¨ÊÇCÓï·¨µÄ³¬¼¯µÄ˵·¨¡£
2. C++/CLI ºÍ C# ÊÇ΢ÈíµÄ£¬ËüÃÇÓëCºÍC++ûÓÐÈκιØϵ£¬ËäÈ»²¿·ÖÓï·¨ÏàËÆ¡£µ«ÄÄÁ½ÖÖÓïÑÔ²»ÏàËÆÄØ£¿¶¼ÊÇabcÕâ26¸ö×Öĸ¡£
3. ²»ÒªÊ¹ÓÃTC/TC++/BC/CBµÈ¹ÅÀϵıàÒëÆ÷À´Ñ§Ï°C/C++£¬ÒòΪËüÃÇÌ«¹ÅÀÏÁË£¬²»Ö§³ÖеÄC/C++±ê×¼¡£²»ÒªÊ¹ÓÃCBX/VC++6.0/VC2005µÈ¶ÔC/C++±ê×¼Ö§³Ö²»ºÃµÄ±àÒëÆ÷£¬ËäÈ»ÕâЩ±àÒëÆ÷ÊʺϹ¤×÷£¬µ«²»ÊʺÏѧϰ£¬ÒòΪËüÃÇÖеÄÓï·¨ÏÝÚåºÜ¶à¡£¼ÇסΨһÊʺÏѧϰµÄ±àÒëÆ÷ÊÇgcc/mingw¡£[antigloss×¢£ºDev-C++ ʹÓõıàÒëÆ÷¾ÍÊÇgcc & g++]
4. ²»ÒªÓÃ""´úÌæ<>À´°üº¬ÏµÍ³Í·Îļþ£¬ËäÈ»ÓÐЩ±àÒëÆ÷ÔÊÐíÄãÕâÑù×ö£¬µ«Ëü²»·ûºÏC/C++±ê×¼¡£
´íÎóµÄʾÀý£º#include "stdio.h"£¬#include "iostream"¡£[antigloss×¢£ºÏ°¹ßÉÏ£¬<> ÓÃÓÚ°üº¬±ê׼ͷÎļþºÍϵͳͷÎļþ£¬"" ÓÃÓÚ°üº¬×Ô¶¨ÒåÍ·Îļþ¡£±ê×¼ËƺõûÓÐÃ÷È·¹æ¶¨²»×¼Óà "" °üº¬±ê׼ͷÎļþºÍϵͳͷÎļþ¡£Ê¹Óà "" °üº¬±ê׼ͷÎļþ»òÕßϵͳͷÎļþÖ»ÄÜ˵ÊÇÒ»ÖÖ²»Á¼·ç¸ñ¡£]
5. ²»Òª½«mainº¯ÊýµÄ·µ»ØÀàÐͶ¨ÒåΪvoid£¬ËäÈ»ÓÐЩ±àÒëÆ÷ÔÊÐíÄãÕâÑù×ö£¬µ«Ëü²»·ûºÏC/C++±ê×¼¡£²»Òª½«º¯ÊýµÄint·µ»ØÀàÐÍÊ¡ÂÔ²»Ð´£¬ÔÚC++ÖÐÒªÇó±àÒëÆ÷ÖÁÉÙ¸øÒ»¸ö¾¯¸æ¡£´íÎóµÄʾÀý£ºvoid main() {}£¬main() {} [antigloss×¢£ºC99ºÍC++98¶¼ÒªÇó±àÒëÆ÷¶ÔÊ¡ÂÔintÖÁÉÙ·¢³öÒ»¸ö¾¯¸æ]
6. ²»Òª°ÑVC++ÖÐµÄ #include "stdafx.h" Ìù³öÀ´£¬ËüÊÇÔ¤±àÒëÍ·Îļþ¡£ÈçͬÉϲËʱ²»Òª°Ñ³øʦҲ·Åµ½ÍÐÅÌÖС£
7. [C++]²»Òª#include <iostream.h>£¬²»Òª#include <string.h>£¬ÒòΪËüÃÇÒѾ±»C++±ê×¼Ã÷È·µÄ·ÏÆúÁË£¬Çë¸ÄΪ #include <iostream> ºÍ #include <cstring>¡£¹æÔò¾ÍÊÇ£º
a. Èç¹ûÕâ¸öÍ·ÎļþÊǾÉC++ÌØÓеģ¬ÄÇôȥµô.hºó׺£¬²¢·ÅÈëstdÃû×ֿռ䣬
±ÈÈç iostream.h ±äΪ iostream¡£
b. Èç¹ûÕâ¸öÍ·ÎļþÊÇCÒ²Óеģ¬ÄÇôȥµô.h
Ïà¹ØÎĵµ£º
×î½ü¶Ô»ù´¡ÖªÊ¶½øÐÐÁËѧϰ£¬·¢ÏÖÒÔÇ°ºÜ¶à¶«Î÷¶¼Ã»ÓиãÇå³þ
1. ±àÒëµÄÎÊÌ⣬ͷÎļþÖ÷ÒªÊǶ¨Òå
//////// add.c
int add(int a, int b)
{
return a + b;
}
///////// main.c
#include <stdio.h>
int add(int a, int b);
int main ()
{
printf("%d" ......
¹Ø¼üµÄʱ¿Ì - MFC Or Not
ÔÚSymantec C/C++ºÍWatcom C/C++Öð½¥µØÕ¾ÎÈÁ˽Ų½Ö®ºó£¬ËÄ´ó±àÒëÆ÷¾öÕ½µÄʱ¿ÌÒ²Ö𽥱ƽüÁË¡£ÔÚ1994ÄêδµÄ¾öս֮ǰ£¬SymantecºÍWatcomͬʱÃæ¶ÔÁËÒ»¸ö·Ç³£ÑÏÀ÷µÄ¿¼Ñ飬ÄǾÍÊÇC/C++ FrameworkµÄÑ¡Ôñ¡£ËäÈ»SymantecºÍWatcom¶¼ÒÔ¸÷×ÔµÄÌØÉ«Õ¼µÃÁËÊг¡£¬²»¹ýÔÚµ±Ê±¶ÔÓÚÒ»¸öC/C++¿ª·¢¹¤¾ßÀ´Ëµ£¬×îÖØÒªµÄÒ ......
×î½üÔÚ¿´¡¶c³ÌÐòÉè¼ÆÓïÑÔ¡·£¬¾ÍÊÇÄDZ¾±»ÓþΪCÓïÑÔÊ¥¾µÄÊé¼®¡£¼¸Ìì¿´ÁËÒ»Õ£¬¸Ð´¥ºÜ´ó£¬¿ªÆª¾ÍÉæ¼°µ½ºÜ¶àʵÓóÌÐò£¬²»ÏñÌ·ºÆÇ¿ÄÇÑùÈÃÈËÉîÏÝÓ﷨ϸ½ÚÖ®ÖУ¬¶øÇÒѧÍêÌ·µÄÊé¸Ð¾õʲô¶¼²»ÄÜ×ö¡£ºÜ¶àÎÊÌâÌ·¶¼»Ø±ÜÁË¡£Ëùνרҵ¿´¿´c³ÌÐòÉè¼ÆÓïÑԵĴúÂëµÄ·ç¸ñ¾ÍÄܸÐÊܵ½£¬Ò»ÖÖ¾«Ðĵñ×ÁµÄÒÕÊõÆ·¡£µÚÒ»ÕÂÓÐ ......
C/C++
/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê4ÔÂ29ÈÕ, ÉÏÎç9:46
*/
#include <iostream>
using namespace std;
int maximum(int[], int);
int main(int argc, char** argv) {
// int sg[3][4] = {
int sg[][4] = {
{68, 77, 73, 86},
{87, 96, 7 ......
Ç°ÑÔ ²»¶ÏÓÐÍøÓѽ«±àÒëÆ÷ GCC ÎóÈÏΪ IDE£¨¼¯³É¿ª·¢»·¾³£©
ÆÚÍûÍÑÀëÃüÁîÐÐ
ÆÚÍûÄÜÔڲ˵¥Öз¢ÏÖÆäÉíÓ°
ÆÚÍûÆäÄÜÓÐÒ»¸ö¼¯±à¼±àÒëÁ´½Óµ÷ÊÔÔËÐÐÓÚÒ»ÌåµÄ½çÃæ
¹Ê±¾Îĸø´ó¼Ò¼òµ¥ÂÞÁÐһЩ C/C++ ±à³ÌÖпÉÓÃµÄ IDE£¬»òÐíÄã´ÓÖпÉÒÔÕÒÒ»¸öÄãϲ»¶µÄ¡£
Ϊ±ÜÃâÒÔÏÂij¸öÈí¼þ°²×°Ê±²»×Ô¶¯°²×° ......