使用MSVC ++ 6.00编译C代码时出现问题 [英] Problem in compiling a C code with MSVC++6.00

查看:49
本文介绍了使用MSVC ++ 6.00编译C代码时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



大家好,


我为一个简单的有限元分析写了一个标准的C代码

in MSVC ++。当我将文件保存为cpp文件时,它会完美地编译并运行

,但是当我将其保存为ac文件时,编译时会出现很多错误和

警告阶段。我对这个问题感到很困惑

因为我甚至不熟悉C ++而我的代码只包含简单的

C函数。谁能告诉我这是我的错误?是否有其他方式

而不是在保存阶段将文件的扩展名从.cpp改为

..c让编译器知道这只是一个C $ / $
文件而不是C ++?


另外一个问题我还需要用gcc编译我的代码,但

编译不成功,它会出现以下错误:

初始化中的不兼容类型。你能告诉我怎么写

并保存我的代码,以便它与操作系统无关。在MSVC ++中是否有任何

设置应该更改,或者问题是我的

代码。


这是我的整个代码(对不起,它有点冗长!)。如果有人可以看一下并给我一些提示,我会非常感激。


Babak

#include < stdio.h>

#include< stdlib.h>

#include< string.h>

#include< math.h>

struct element {

int p1;

int p2;

int p3;

int er;

};


struct node {

float x;

float y;

};

void checkfile(FILE *);

void read_node_data(FILE *,struct node *);

void read_element_data(FILE *,FILE *,struct element *,int *);

void ss(struct node *,struct node *,struct node *,int * ,float *,int

*,float *);

void assembly(int *,int *,int *,float *,float **,float *,float *);


int main(无效){


FILE * fp;

FILE * ft;

FILE * fer;

FILE * ftest;

int i;

int j;

in t NUMNODE = 0; //节点数

int NUMELE = 0; //元素数

char * str;

struct node * nd;

struct element * ele;

int * g;


str =(char *)malloc(sizeof( char)* 80);

fp = fopen(" femesh2_p.txt"," r");

ftest = fopen(" nodeindex_2.txt", " w");

checkfile(fp);

checkfile(ftest);

while(!feof(fp)){

fgets(str,77,fp);

fprintf(ftest,"%d%s \ n",NUMNODE + 1,str);

NUMNODE ++;

}

fcloseall();

ft = fopen(" femesh2_t.txt"," r");

checkfile(ft);

while(!feof(ft)){

fgets(str,79,fp) ;

NUMELE ++;

}

fclose(ft);

free(str);

//为读取P,T和er和g数组分配足够的内存

nd =(struct node *)malloc(sizeof(struct node)* NUMNODE);

if(!nd) {

printf(无法为节点分配内存!);

退出(1);

}

ele =(struct element *)malloc(sizeof(struct element)* NUMELE);

if(!ele){

printf(无法分配内存for elements!");

exit(1);

}

g =(int *)malloc(sizeof(* g)* NUMELE);

if(!g){

printf(无法为电荷密度分配内存!);

退出( 1);

}


浮动** K;

K =(浮动**)malloc(NUMNODE * sizeof( float *));

if(K!= NULL)

for(i = 0;我< NUMNODE; i ++){

K [i] =(float *)malloc(NUMNODE * sizeof(float));

if(K [i] == NULL){

printf(不能为全局刚度分配内存

矩阵!;

退出(1);

}

}


float * b;

b =(float *)malloc(NUMNODE * sizeof(float *) );

if(b == NULL){

printf(不能为右手侧矢量分配内存!);

退出(1);

}


//接下来我们将K和b的元素初始化为零

for(i = 0; i< NUMNODE; i ++){

for(j = 0; j< NUMNODE; j ++)

K [i] [j] = 0;

b [i] = 0;

}

//读取和存储节点信息(P阵列)


fp = fopen(" femesh2_p.txt"," r");

checkfile(fp);

for(i = 0; i< NUMNODE; i ++)

read_node_data(fp,nd + i);

fclose(fp);

ft = fopen(" femesh2_t。 txt"," r& ;);

checkfile(ft);

fer = fopen(" femesh2_er.txt"," r");

checkfile(fer);

//读取和输出元素信息(T和er数组)

for(i = 0; I< NUMELE; i ++)

read_element_data(ft,fer,ele + i,g + i);

// printf("%d \ n",*(g + i));

fcloseall();

//现在所有信息都可用,我们将继续

计算

//每个元素的刚度矩阵

float Me [3] [3] = {NULL};

float be [3] [1 ] = {NULL};

for(i = 0; i< NUMELE; i ++){

ss((nd +((ele + i) - > p1) -1),(ND +((ELE + I) - > P2)-1),(ND +((ELE + I) - > P3)-1),及((ELE + I) - > ER ),& Me [0] [0],

g + i,& be [0] [0]);

int n1 =(((ele + i) - > p1)-1);

int n2 =(((ele + i) - > p2)-1);

int n3 = (((ele + i) - > p3)-1);

汇编(& n1,& n2,& n3,& Me [0] [0],K, & be [0] [0],b);

}


//下一步是将边界条件应用于全局刚度
矩阵

for(i = 0; i< NUMNODE; i ++){

float param =(((nd + i) - > y) *((nd + i) - > y)+(((nd + i) - > x)-10)*

( ((nd + i) - > x)-10));

if(param> (0.74 * 0.74)&& param< (0.75 * 0.75)&& ((nd + i) - > y)!= 0

){

K [i] [i] = 1e + 8;

b [i] = 0;

printf("%d \ n",i + 1);


}

}

//

fp = fopen(" SS2.DAT"," w");

ft = fopen (LOAD2.DAT,w);

checkfile(fp);

checkfile(ft);


for(i = 0; i< NUMNODE; i ++){

for(j = 0; j< NUMNODE; j ++){

if(j ==( NUMNODE-1))

fprintf(fp,"%f \ n",K [i] [j]);

else

fprintf(fp,"%f",K [i] [j]);


}


fprintf(ft ,%f \ n,b [i]);

}

fcloseall();

// printf( "%f \ n",K [70] [70]);

// printf("%f \ n",b [70]);
< br $>
免费(g);

免费(ele);

免费(nd);

for(i = 0; i< NUMNODE; i ++)

免费(K [i]);

免费(K);

免费(b) ;

返回0;

}

//此函数检查指定的文件是否已打开!

void checkfile(FILE * f )

{

if(!f){

printf(不能打开文件);

退出(1);

}

}


//此函数读取节点协调

void read_node_data(FILE * input,struct node * nod)

{

fscanf(输入,"%f",&(nod-> ; x));

fscanf(输入,%f,&(nod-> y));

}

//这个函数读取元素信息

void read_element_data(FILE * f1,FILE * f2,struct element * element,

int * charge)

{

fscanf(f1,"%d",&(element-> p1));

fscanf(f1,"%d", &(element-> p2));

fscanf(f1,"%d",&(element-> p3));

fscanf( f2,%d,&(element-> er));

fscanf(f2,"%d",收费);

}


//此函数计算局部刚度矩阵

void ss(struct node * n1,struct node * n2,struct node * n3,int * err,

float * MeMat,int * g,float * be)

{

int k,j;

浮动a,r [3],q [3];

//将本地元素初始化为零

for (k = 0; k <3; k ++){

for(j = 0; j <3; j ++){

*(MeMat + 3 * k + j) )= 0;

}

*(be + k)= 0;

}

for(k = 0; k <3; k ++){

q [0] =(n2-> y) - (n3-> y);

q [1] = (n3-> y) - (n1-> y);

q [2] =(n1-> y) - (n2-> y);

r [0] =(n3-> x) - (n2-> x);

r [1] =(n1-> x) - (n3-> x);

r [2] =(n2-> x) - (n1-> x);

}

a =(q [0 ] * r [1] -q [1] * r [0])/ 2;


for(j = 0; j <3; j ++)

for(k = j; k <3; k ++)

{

*(MeMat + 3 * k + j)+ =((* err)/( 4 * a))* q [j] * q [k];

if(j!= k)

*(MeMat + 3 * j + k)+ =((* ERR)/(4 * A))* q [J] * q [k]的; <
}


for(j = 0; j <3; j ++)


for(k = j; k< 3; k ++)

{

*(MeMat + 3 * k + j)+ =((* err)/(4 * a))* r [ j] * r [k];

if(j!= k)

*(MeMat + 3 * j + k)+ =((* err)/( 4 * a))* r [j] * r [k];

}

for(k = 0; k <3; k ++)

*(be + k)=((* g)* a)/ 3;

}

//这个函数将局部刚度矩阵的元素组装成

全局矩阵

void程序集(int * n1,int * n2,int * n3,float * local,float ** global,

float * be,float * b)

{

//组装全局矩阵

global [* n1] [* n1] + = *(本地);

全球[* n2] [* n2] + = *(本地+4);

全球[* n3] [* n3] + = *(local + 8);

global [* n1] [* n2] + = *(local + 1);

global [* n2] [* n1] + = *(local + 1);

global [* n1] [* n3] + = *(local + 2);

global [* n3] [* n1] + = *(本地+2);

全局[* n2] [* n3] + = *(本地+5);

全局[* n3] [* n2] + = *(本地+5);

// Assembli ng load vector

b [* n1] + = * be;

b [* n2] + = *(be + 1);

b [ * n3] + = *(be + 2);

}

解决方案

Babak写道:< blockquote class =post_quotes>
大家好,
我已经在MSVC ++中为一个简单的有限元分析编写了一个标准的C代码。当我将文件保存为cpp文件时,它会完美地编译和运行,但是当我将其保存为c文件时,在编译阶段会有很多错误和警告。我真的很困惑这个问题
因为我甚至不熟悉C ++
而且我的代码只包含简单的C函数。谁能告诉我这是我的错误?
这是我的整个代码(对不起,它有点冗长!)。




这比模糊的要好得多。


很可能你的c代码是根据C89规则编译的

,其中有一些C99功能作为扩展名,比如// comments。


在开头的主要

中整合所有对象声明。 C89不允许声明

复合语句中的语句{在块中}。

并且不要使用{NULL}初始化float数组,

改为使用{0}。


int main(无效)

{

FILE * fp;

FILE * ft;

FILE * fer;

FILE * ftest;

int i;

int j;

int NUMNODE = 0; //节点数

int NUMELE = 0; //元素数

char * str;

struct node * nd;

struct element * ele;

int * g;

float ** K;

float * b;

float Me [3] [3] = {0};

float be [3] [1] = {0};

int n1;

int n2;

int n3;


-

pete


文章< 11 *********** ***********@b68g2000cwa.googlegroups .com> ;,

Babak< b。******* @ gmail.com>写道:

我已经为MSVC ++中的简单有限元分析编写了标准C代码。当我将文件保存为cpp文件时,它会完美地编译和运行,但是当我将其保存为c文件时,编译阶段会出现很多错误和警告。我真的很困惑这个问题
因为我甚至不熟悉C ++而且我的代码只包含简单的C函数。谁能告诉我这是我的错误?


您使用C ++和C99中允许的两个功能,但不使用C90:

斜杠 - 斜杠注释和声明与代码混合。也许

您的编译器不接受这些新功能。将你的

评论更改为/ *这个样式* /并将你的声明移到函数或块的

开头。

float Me [ 3] [3] = {NULL};
float be [3] [1] = {NULL};




这也是错误的;你应该使用0而不是NULL。对于指针,NULL是

。 (它可能适用于某些系统,具体取决于NULL

的定义,但无论如何都是错误的。)


- Richard


Babak发布:

str =(char *)malloc(sizeof(char)* 80);



你知道,sizeof(char)总是1.你可以写:


str = malloc( 80);

演员是多余的。


int n1 =(((ele + i) - > p1)-1);
int n2 =(((ele + i) - > p2)-1);
int n3 =(((ele + i) - > p3)-1);



您可能很高兴知道C还有另一种写作方式:

int n1 = ele [i] .p1 - 1 ;

int n2 = ele [i] .p2 - 1;

int n3 = ele [i] .p3 - 1;

float param =(((nd + i) - > y)*((nd + i) - > y)+(((nd + i) - > x)-10)*
((( ND + I) - &X的催化剂)-10));



再来一次:

float param = nd [i] .y * nd [i] .y *(nd [i]。 x - 10)*(nd [i] .x - 10);


全局[* n1] [* n1] + = *(本地);
全局[ * n2] [* n2] + = *(本地+4);
全局[* n3] [* n3] + = *(本地+8);
全局[* n1] [* n2 ] + = *(本地+ 1);
全局[* n2] [* n1] + = *(本地+ 1);
全局[* n1] [* n3] + = *(本地+2);
全局[* n3] [* n1] + = *(本地+2);
全局[* n2] [* n3] + = *(本地+5);
global [* n3] [* n2] + = *(local + 5);
//组装载荷矢量
b [* n1] + = * be;
b [* n2] + = *(be + 1);
b [* n3] + = *(be + 2);




再来一次:


global [* n1] [* n1] + = * local;

global [* n2] [* n2] + = local [4];

global [* n3] [* n3] + = local [8];


-


Frederick Gotham



Hi Everyone,

I''ve written a standard C code for a simple finite element analysis
in MSVC++ . When I save the file as a cpp file, it compiles and runs
perfectly, but when I save it as a c file, there are lots of errors and
warnings in compiling stage. I am really confused about this problem
because I''m not even familiar with C++ and my code only includes simple
C functions. Can anybody please tell me what''s my mistake? Is there any
other way rather than changing the extension of the file from .cpp to
..c during the save stage to let the compiler know that this is just a C
file and not a C++?

As another question I also need to compile my code with gcc, but the
compilation is not successful and it gives the following error: "
Incompatible types in initialization". Can you pls tell me how to write
and save my code so that it will be OS independent. Is there any
settings in MSVC++ that should be changed or the problem is with my
code.

Here is my entire code (Sorry it''s a little lengthy!). I would be
very grateful if somebody can have a look at it and give me some hints.

Babak
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
struct element {
int p1;
int p2;
int p3;
int er;
};

struct node {
float x;
float y;
};
void checkfile (FILE *);
void read_node_data (FILE *, struct node *);
void read_element_data (FILE *,FILE *, struct element *, int *);
void ss(struct node*,struct node*, struct node*, int *, float * ,int
*,float *);
void assembly(int *, int *,int *, float *, float **, float *, float *);

int main(void) {

FILE *fp;
FILE *ft;
FILE *fer;
FILE *ftest;
int i;
int j;
int NUMNODE=0;//number of nodes
int NUMELE=0;//number of elemnts
char *str;
struct node *nd;
struct element *ele;
int *g;

str=(char *)malloc(sizeof(char)*80);
fp=fopen("femesh2_p.txt", "r");
ftest=fopen("nodeindex_2.txt", "w");
checkfile (fp);
checkfile (ftest);
while (!feof(fp)) {
fgets (str,77,fp);
fprintf(ftest, "%d %s \n", NUMNODE+1, str);
NUMNODE ++;
}
fcloseall();
ft=fopen("femesh2_t.txt", "r");
checkfile (ft);
while (!feof(ft)) {
fgets (str,79,fp);
NUMELE ++;
}
fclose(ft);
free(str);
//allocating enough memory for reading P,T and er and g arrays
nd=(struct node*)malloc(sizeof(struct node) * NUMNODE);
if (!nd) {
printf("cannot allocate memory for nodes!");
exit(1);
}
ele=(struct element*) malloc(sizeof(struct element) * NUMELE);
if (!ele) {
printf("cannot allocate memory for elements!");
exit(1);
}
g=(int *) malloc(sizeof(*g) * NUMELE);
if (!g) {
printf("cannot allocate memory for charge density!");
exit(1);
}

float **K;
K = (float **) malloc( NUMNODE * sizeof( float*));
if( K != NULL)
for( i = 0; i < NUMNODE; i++){
K[i] =(float *) malloc( NUMNODE * sizeof( float) );
if( K[i] == NULL) {
printf("cannot allocate memory for global stiffness
matrix!");
exit (1);
}
}

float *b;
b= (float *) malloc (NUMNODE * sizeof (float *));
if (b==NULL) {
printf ("cannot allocate memory for Right Hand Side Vector!");
exit (1);
}

// next we initialze elements of K and b to zero
for ( i = 0; i < NUMNODE; i++) {
for ( j = 0; j < NUMNODE; j++)
K[i][j]=0;
b[i]=0;
}
// reading and storing node information (P array)

fp=fopen("femesh2_p.txt", "r");
checkfile (fp);
for (i=0; i<NUMNODE; i++)
read_node_data(fp,nd+i);
fclose(fp);
ft=fopen("femesh2_t.txt", "r");
checkfile(ft);
fer=fopen("femesh2_er.txt", "r");
checkfile(fer);
// reading and stroing element information (T and er arrays)
for (i=0; i<NUMELE; i++)
read_element_data(ft, fer, ele+i, g+i);
//printf ("%d \n",*(g+i));
fcloseall();
// Now that all the information are available, we''ll proceed to
calculate
//stiffness matrix for each element
float Me[3][3]={NULL};
float be [3] [1]={NULL};
for (i=0; i<NUMELE; i++) {
ss((nd+((ele+i)->p1)-1),(nd+((ele+i)->p2)-1),(nd+((ele+i)->p3)-1),&((ele+i)->er),&Me[0][0],
g+i, &be[0][0]);
int n1=(((ele+i)->p1)-1);
int n2=(((ele+i)->p2)-1);
int n3=(((ele+i)->p3)-1);
assembly (&n1,&n2,&n3,&Me[0][0], K, &be[0][0], b);
}

//The next step is to apply boundary conditions to global stiffness
matrix
for (i=0; i<NUMNODE; i++) {
float param=(((nd+i)->y) * ((nd+i)->y) + (((nd+i)->x)-10) *
(((nd+i)->x)-10));
if ( param > (0.74 * 0.74) && param < (0.75 * 0.75) && ((nd+i)->y)!=0
) {
K [i] [i] = 1e+8;
b [i] = 0;
printf("%d \n" ,i+1);

}
}
//
fp=fopen("SS2.DAT","w");
ft=fopen("LOAD2.DAT","w");
checkfile(fp);
checkfile(ft);

for(i=0;i<NUMNODE;i++) {
for(j=0;j<NUMNODE;j++) {
if (j==(NUMNODE-1))
fprintf(fp,"%f \n", K[i][j]);
else
fprintf(fp,"%f ", K[i][j]);

}

fprintf(ft,"%f \n ", b[i]);
}
fcloseall();
//printf ("%f \n", K[70][70]);
//printf ("%f \n", b[70]);

free(g);
free (ele);
free(nd);
for ( i = 0; i < NUMNODE; i++)
free(K[i]);
free(K);
free(b);
return 0;
}
// This function checks if the specified file is opened or not!
void checkfile (FILE * f)
{
if(!f) {
printf("can''t open the file");
exit(1);
}
}

// This function reads the node coordination
void read_node_data (FILE * input, struct node *nod)
{
fscanf (input,"%f", &(nod->x));
fscanf (input,"%f", &(nod->y));
}
//This function reads element information
void read_element_data (FILE * f1,FILE * f2, struct element * element,
int *charge)
{
fscanf(f1,"%d", &(element->p1));
fscanf(f1,"%d", &(element->p2));
fscanf(f1,"%d", &(element->p3));
fscanf(f2,"%d", &(element->er));
fscanf(f2,"%d", charge);
}

// This function calculates the local stiffness matrix
void ss(struct node *n1,struct node *n2, struct node *n3, int *err,
float *MeMat, int *g ,float *be)
{
int k,j;
float a,r[3],q[3];
//initialize local elements to zero
for(k=0;k<3;k++) {
for(j=0;j<3;j++) {
*(MeMat+3*k+j)=0;
}
*(be+k)=0;
}
for(k=0;k<3;k++) {
q[0]=(n2->y)-(n3->y);
q[1]=(n3->y)-(n1->y);
q[2]=(n1->y)-(n2->y);
r[0]=(n3->x)-(n2->x);
r[1]=(n1->x)-(n3->x);
r[2]=(n2->x)-(n1->x);
}
a=(q[0]*r[1]-q[1]*r[0])/2;

for(j=0;j<3;j++)
for(k=j;k<3;k++)
{
*(MeMat+3*k+j) += ((*err)/(4*a))*q[j]*q[k];
if (j!=k)
*(MeMat+3*j+k)+=((*err)/(4*a))*q[j]*q[k];
}

for(j=0;j<3;j++)

for(k=j;k<3;k++)
{
*(MeMat+3*k+j) +=((*err)/(4*a))*r[j]*r[k];
if (j!=k)
*(MeMat+3*j+k)+=((*err)/(4*a))*r[j]*r[k];
}
for(k=0;k<3;k++)
*(be+k)=((*g)*a)/3;
}
// This function assembles the elements of local stiffness matrix into
global matrix
void assembly(int *n1, int *n2,int *n3, float *local, float ** global,
float *be, float *b)
{
//Assembling the global matrix
global[*n1][*n1]+= * (local);
global[*n2][*n2]+= * (local+4);
global[*n3][*n3]+= * (local+8);
global[*n1][*n2]+= * (local+1);
global[*n2][*n1]+= * (local+1);
global[*n1][*n3]+= * (local+2);
global[*n3][*n1]+= * (local+2);
global[*n2][*n3]+= * (local+5);
global[*n3][*n2]+= * (local+5);
//Assembling load vector
b[*n1]+= *be;
b[*n2]+= *(be+1);
b[*n3]+= *(be+2);
}

解决方案

Babak wrote:


Hi Everyone,

I''ve written a standard
C code for a simple finite element analysis
in MSVC++ . When I save the file as a cpp file, it compiles and runs
perfectly, but when I save it as a c file,
there are lots of errors and
warnings in compiling stage. I am really confused about this problem
because I''m not even familiar with C++
and my code only includes simple
C functions. Can anybody please tell me what''s my mistake? Here is my entire code (Sorry it''s a little lengthy!).



That''s much better than being vague.

Most likely your c code is being compiled according to C89 rules
with some C99 features as extensions, like // comments.

Consolidate all of you object declarations in main
at the begining. C89 doesn''t allow declarations
after statements within a compound statement {within a block}.
And don''t initialise arrays of float, with {NULL},
use {0} instead.

int main(void)
{
FILE *fp;
FILE *ft;
FILE *fer;
FILE *ftest;
int i;
int j;
int NUMNODE=0;//number of nodes
int NUMELE=0;//number of elemnts
char *str;
struct node *nd;
struct element *ele;
int *g;
float **K;
float *b;
float Me[3][3]={0};
float be [3] [1]={0};
int n1;
int n2;
int n3;

--
pete


In article <11**********************@b68g2000cwa.googlegroups .com>,
Babak <b.*******@gmail.com> wrote:

I''ve written a standard C code for a simple finite element analysis
in MSVC++ . When I save the file as a cpp file, it compiles and runs
perfectly, but when I save it as a c file, there are lots of errors and
warnings in compiling stage. I am really confused about this problem
because I''m not even familiar with C++ and my code only includes simple
C functions. Can anybody please tell me what''s my mistake?
You use two features which are allowed in C++ and C99 but not C90:
slash-slash comments and declarations mixed with code. Perhaps
your compiler does not accept these new features. Change your
comments to /* this style */ and move your declarations to the
start of the function or block.
float Me[3][3]={NULL};
float be [3] [1]={NULL};



This is also wrong; you should use 0 rather than NULL. NULL is
for pointers. (It may work on some systems depending on how NULL
is defined, but it''s wrong anyway.)

-- Richard


Babak posted:

str=(char *)malloc(sizeof(char)*80);

Just so you know, sizeof(char) is always 1. You could have written:

str = malloc(80);
The cast is redundant.

int n1=(((ele+i)->p1)-1);
int n2=(((ele+i)->p2)-1);
int n3=(((ele+i)->p3)-1);

You might be pleased to know that C has another way of writing that:
int n1 = ele[i].p1 - 1;
int n2 = ele[i].p2 - 1;
int n3 = ele[i].p3 - 1;
float param=(((nd+i)->y) * ((nd+i)->y) + (((nd+i)->x)-10) *
(((nd+i)->x)-10));

Again here:
float param = nd[i].y * nd[i].y * (nd[i].x - 10) * (nd[i].x - 10);

global[*n1][*n1]+= * (local);
global[*n2][*n2]+= * (local+4);
global[*n3][*n3]+= * (local+8);
global[*n1][*n2]+= * (local+1);
global[*n2][*n1]+= * (local+1);
global[*n1][*n3]+= * (local+2);
global[*n3][*n1]+= * (local+2);
global[*n2][*n3]+= * (local+5);
global[*n3][*n2]+= * (local+5);
//Assembling load vector
b[*n1]+= *be;
b[*n2]+= *(be+1);
b[*n3]+= *(be+2);



Again here:

global[*n1][*n1] += *local;
global[*n2][*n2] += local[4];
global[*n3][*n3] += local[8];

--

Frederick Gotham


这篇关于使用MSVC ++ 6.00编译C代码时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆