易截截图软件、单文件、免安装、纯绿色、仅160KB

C中读取数组

#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 100
main()
{
FILE *fp;
if ( (fp = fopen( "c:\\a.txt", "r" )) == NULL ) printf("ERROR!\n");
int tmp[MAXSIZE];
int i;
for ( i=0; i<MAXSIZE; i++ )
{
tmp[i] = 0;
}
char chtmp[10000];
i=0;
while ( !feof(fp) && i!=MAXSIZE )
{
fscanf( fp, "%d ", &tmp[i] );
//printf("tmp[%d]=%d",i,tmp[i]);
i++;
}
for ( i=0; i<MAXSIZE; i++ )
{
printf( "tmp[%3d]=%d\n", i, tmp[i] );
}
fclose( fp );
system("PAUSE");
}
TXT文件需要放在c盘根目录
[][][][][]TXT文件内容如下:
1234 5 6 6 6 7 8 8 8356 8 3568 35 8 136 1 8 07 86 89765 7895 765 786 4 654 654 8 790 870 987 0987 87 69 8756 765 87 65 8765 84 3 54 3 458 76 0987 -908 -908 -709 0986 98 76 06 985 7 4 423 6542 6543


相关文档:

linux C正则表达式——POSIX正则测试

这是C的原程序
#include <stdio.h>
#include <regex.h>
int main(int argc, char** argv)
{
regex_t reg;
regmatch_t pm[10];
char *pattern;
char buf[50];
const size_t nmatch = 10;

pattern = argv[1];
int result = regcomp(®, pattern, REG_EXTENDED);
while( fgets ......

C/C++圣战(一)


标签:
it
分类:C/C++
我的回忆和有趣的故事 --- C/C++圣战篇
李维
------------------------------------------------------------------------------------------
声明
以下的这篇文章内容是我个人的回忆以及看法,没有任何特别的偏见,许多的事情是根据我的记忆以及从许多人的诉说中得知的,也许内容不是百分 ......

C/C++与Java多维数组,遍历与最大值获取方法!

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 ......

ubuntu c/c++ IDE(开发环境)

前言 不断有网友将编译器 GCC 误认为 IDE(集成开发环境)       
期望脱离命令行
期望能在菜单中发现其身影
期望其能有一个集编辑编译链接调试运行于一体的界面
故本文给大家简单罗列一些 C/C++ 编程中可用的 IDE,或许你从中可以找一个你喜欢的。
为避免以下某个软件安装时不自动安装 ......

c操作翻转字符串


#include<stdio.h>
#include<malloc.h>
#include<string.h>
/*
* 翻转
*/
char *mystrrev(char *arr)
{
if (!arr)
{
return NULL;
}
char *temp = arr;
char t;
int leng = strlen(arr) + 1;
int l = (int)(leng / 2);
int i = 0;
while (l--)
{
t = arr[i];
arr[ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号