Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
arr1point.c
Package: C语言精彩编程百例_源代码.rar [view]
Upload User: bjtelijie
Upload Date: 2010-01-01
Package Size: 87k
Code Size: 1k
Category:
Algorithm
Development Platform:
Visual C++
- # include <stdio.h>
- void inv(int *x, int n);
- void main()
- {
- int i;
- int array[10] = {1, 3, 9, 11, 0, 8, 5, 6, 14, 98};
- printf("原始数组是:n");
- for(i=0; i<10; i++)
- printf("%d " , array[i]);
- printf("n");
- inv(array, 10);
- printf("按相反次序存放后的数组为:n");
- for(i=0; i<10; i++)
- printf("%d ", array[i]);
- printf("n");
- }
- void inv(int *x, int n)
- {
- int *p, *i, *j;
- int t;
- int m = (n-1)/2;
- i = x;
- j = x + n - 1;
- p = x + m;
- for(; i<=p; i++, j--)
- {
- t = *i;
- *i = *j;
- *j = t;
- }
- }