User Name: Password:
New User Registration
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)



What is new about MP3 players?
List of discussion boards
Mode: Everyone can post
Search in posts:  

18. February 2005, 16:45:49
Chessmaster1000 
Subject: I want a tiny help............
Modified by Chessmaster1000 (18. February 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...........?

Date and time
Friends online
Favourite boards
Fellowships
Tip of the day
Copyright © 2002 - 2024 Filip Rachunek, all rights reserved.
Back to the top