Username: Passwort:
Neue User - Registrierung
Moderator: 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)



Was gibt es neues über dvd players?
Liste der Diskussionsforen
Modus: Jeder kann schreiben
In Postings suchen:  

18. Feburar 2005, 16:45:49
Chessmaster1000 
Thema: I want a tiny help............
Verändert von Chessmaster1000 (18. Feburar 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 und Zeit
Freunde Online
Abonnierte Foren
Vereine
Tip des Tages
Copyright © 2002 - 2024 Filip Rachunek, all rights reserved.
Zurück nach oben