Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] when i use array with with function the compiler assign as an error in the data type

Status
Not open for further replies.
it work ok and give the coorrect

---------- Post added at 20:13 ---------- Previous post was at 19:14 ----------

void arrange_message(unsigned char*,unsigned char data_order);
**************************************************
arrange_message(THREE,1);
**********************************
void arrange_message(unsigned char data_wrtn[],unsigned char data_order)
{
unsigned char p;
if(data_order==1)
{
for(p=0;p<=15;p++)
{
temp1[p]= data_wrtn[p];
}
}
}
*****************************************
finally it work ok
 

I´m still curious about this implementation :

void arrange_message(unsigned char*,unsigned char data_order);
There is not missing the 1rst input variable ?

+++
 

finally it work ok

I don't understand, why wasn't it working the first time and it woks now?

I´m still curious about this implementation :
There is not missing the 1rst input variable ?

I have no idea how this works because I have never used this way.

What I usually do is

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
void my_function (char *myarray_p)
{ 
// and then read the array using
   some_variable = *myarray_p++; // assign the value pointed by p, and then increment the address p
   some_other_variable = *myarray_p++; // assign the value pointed by p, and then increment the address p
 
//or it can also be done with a loop.
}
 
//To call the function I send the address of the array
my_function(myarray);



Alex
 

like you i don't know why it isn't work first and work last
i think that first i write that temp1[p]= & data_wrtn[p]; and i do understand why we use the * pointer and what is the meaning of use it with array
i understand that we use use pointer to point to the first parameter in array

---------- Post added at 22:37 ---------- Previous post was at 22:35 ----------

for andre_teprom the function it work and there is no syntax error
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top