用户名: 密码:
新用户注册
监管者: toedder 
 Computers

Have computer questions, hints, or tips?

BBW's Tips on how to speed up page load the brainking site
Computers (BIG BAD WOLF, 2007-03-12 20:16:01)



Microsoft有什么新的?
讨论板列表
状态: 所有人能发表
帖子搜索:  

18. 二月 2005, 16:45:49
Chessmaster1000 
题目: I want a tiny help............
Chessmaster1000修改(18. 二月 2005, 16:46:40)
As i'm in my very first steps at C i need a little help some times.....
One thing i can't do is the following, so if anyone has any idea of how, then please...........:
--------------------------

-----------------------------------
In the following code-1 example the output is:
c[0]= 4
c[1]= 44
c[2]= 84
c[3]= 104
--------------------------------------------

-----------------
Code-1:
////////////////
//
#include <stdio.h>
void f1(int a[]);

void main(void)
{
int c[4],i;
f1(c);
for (i=0;i=3;i++) printf("c[%d]= %d\n",i,c[i]);
}

void f1(int a[])
{
a[0]=4;
a[1]=44;
a[2]=84;
a[3]=10

4;
}
/////////////////////

What i want is to have the same output as before BUT not to declare one by one the values of the a[]. But the following logical way isn't working

//////////////////////


#include <stdio.h>
void f1(int a[]);

void main(void)
{
int c[4],i;
f1(c);
for (i=0;i=3;i++) printf("c[%d]= %d\n",i,c[i]);
}

void f1(int a[])
{
int a[4]={4,44,84,104};
}

//////////////////////


Why??????????????????????? And how i can do it...........?

日期和时间
在线的朋友
最喜欢的讨论板
朋友群
每日提示
Copyright © 2002 - 2024 Filip Rachunek, 版权所有
回顶端