C programming language

来自开放百科 - 灰狐
(重定向自C
跳转到: 导航, 搜索
Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 C programming language Thanks, Wikipedia.

C 是一种在 UNIX 操作系统的早期就被广泛使用的通用编程语言. 它最早是由贝尔实验室的 Dennis Ritchie 为了 UNIX 的辅助开发而写的, 开始时 UNIX 是用汇编语言和一种叫 B 的语言编写的. 从那时候起, C 就成为世界上使用最广泛计算机语言.

C 能在编程领域里得到如此广泛支持的原因有以下一些:

  • 它是一种非常通用的语言. 几乎你所能想到的任何一种计算机上都有至少一种能用的 C 编译器. 并且它的语法和函数库在不同的平台上都是统一的, 这个特性对开发者来说很有吸引力.
  • 用 C 写的程序执行速度很快.
  • C 是所有版本的UNIX上的系统语言.

第一个 C 程序

#include <stdio.h>

int main(void)
{
    printf("hello, world\n");
}

第一个Windows程序

#include <windows.h>

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
{
     MessageBox (NULL, TEXT ("Hello, Windows 98!"), TEXT ("HelloMsg"), 0) ;

     return 0 ;
}

Library

18 headers from the Standard C library.

  • <assert.h> -- for enforcing assertions when functions execute
  • <ctype.h> -- for classifying characters
  • <errno.h> -- for testing error codes reported by library functions
  • <float.h> -- for testing floating-point type properties
  • <iso646.h> -- for programming in ISO 646 variant character sets
  • <limits.h> -- for testing integer type properties
  • <locale.h> -- for adapting to different cultural conventions
  • <math.h> -- for computing common mathematical functions
  • <setjmp.h> -- for executing nonlocal goto statements
  • <signal.h> -- for controlling various exceptional conditions
  • <stdarg.h> -- for accessing a varying number of arguments
  • <stddef.h> -- for defining several useful types and macros
  • <stdio.h> -- for performing input and output
  • <stdlib.h> -- for performing a variety of operations
  • <string.h> -- for manipulating several kinds of strings
  • <time.h> -- for converting between various time and date formats
  • <wchar.h> -- for manipulating wide streams and several kinds of strings
  • <wctype.h> -- for classifying wide characters

基础设施

链接

Comment-32x32.png

<discussion>characters_max=300</discussion>

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱