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

混凝土强度评定系统1.1 c代码

#define NULL 0
#define LEN 10
#define OK printf("\n此组数据合格。\n")
#define NO printf("\n此组数据不合格!\n")
#define CN printf("\n%30c 伟成工作室荣誉出品 %c\n",17,16)
#include "stdlib.h"
#include "math.h"
static float min,ave;       
float *zwfloat(void)        
{
    float *array,value;
    int size,count;
    size=LEN;
    array=malloc((size+1)*sizeof(float));
    if (array==NULL) return NULL;
    count=0;
    while (scanf("%f",&value),value!=0)   
    {
     if(value<0) continue;
        count+=1;
        if (count>size)      
        {
            size+=LEN;
            array=realloc(array,(size+1)*sizeof(float));
            if (array==NULL) return NULL;
        }
        array[count]=value;
    }
    if (count<size)          
    {
        array=realloc(array,(count+1)*sizeof(float));
        if (array==NULL) return NULL;
    }
    array[0]=count;       
    return array;
}
float stdev(float const *p)  
{
    int i;
    float sm=0.0;
    ave=0.0;min=p[1];
    if (p==NULL) return 0;
    for


相关文档:

C/C++——小编谈C语言函数那些事(7)

C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
1.       fgetc函数
fgetc函数的功能是从流中读取字符,其用法是:int fgetc(FILE *stream); 程序例子如下:
#include <string.h ......

C和C++混合编程(__cplusplus使用)


第一种理解
比如说你用C++开发了一个DLL库,为了能够让C语言也能够调用你的DLL输出(Export)的函数,你需要用extern "C"来强制编译器不要修改你的
函数名。
通常,在C语言的头文件中经常可以看到类似下面这种形式的代码:
#ifdef __cplusplus
extern "C" {
#endif
/**** some declaration or so *****/
#ifde ......

用C写的读取代码行数。

今天无事,在论坛上一直看贴子,很少动手实践,今天试着写了一个读取源程序代码行数的例子:
现在的代码如下,可能还有不完善的地方,以后再改进:
#include <stdio.h>
#define CHARCOUNT 255
#define CON 6 /*单行注释最少的时候*/
int realLength = 0;
/*
* function name: strCount
* function : count ......

C/C++——小编谈C语言函数那些事(13)

C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
1.       malloc函数
malloc函数的功能是内存分配函数,其用法为:void *malloc(unsigned size);程序实例如下:
#include <stdio.h>
#i ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号