Přihlašovací jméno: Heslo:
Registrace nového uživatele
Moderátor: 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)



Co je nového o flash disks?
Seznam diskusních klubů
Mód: Každý může psát
Hledat v příspěvcích:  

18. února 2005, 16:45:49
Chessmaster1000 
Subjekt: I want a tiny help............
Změněno uživatelem Chessmaster1000 (18. února 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...........?

Datum a čas
Přátelé on-line
Oblíbené kluby
Společenstva
Tip dne
Copyright © 2002 - 2025 Filip Rachůnek, všechna práva vyhrazena.
Zpět na vrchol