2409 views|4 replies

5

Posts

0

Resources
The OP
 

What does *a in the vodi function (u32 *a) mean to input into the function? [Copy link]

I would like to ask you what does the input of this function mean? Does it mean *p of type u32? In the routine, the input is u32 a[n]; the array is defined like this, and when using this function, it is input as function(a) like this. In addition, in the function, *a++ means pointer address + 1? The input in the routine is the above array, and *a++ means the value of a[x+1] when the routine is executed.


This post is from stm32/stm8

Latest reply

void func(u32* a){ } This is easier to understand. What is sent to the function is a pointer, which is a pointer to the u32 type.  Details Published on 2018-8-29 16:22
 

16

Posts

0

Resources
2
 
The description is a bit hard to understand... What do you mean by void fn(u32 *a); What data is a in the data? If so, then a must be a pointer address of type u32, such as: u32 val = 0; fn( &val); *a++, the value operator is at the same level as the increment operator, and it combines from right to left, so increment first and then value; "*a++ in the routine execution means the value of a[x+1]" I understand what you mean, it should be correct!
This post is from stm32/stm8
 
 

1903

Posts

0

Resources
3
 
It's very simple
This post is from stm32/stm8
 
 

750

Posts

3

Resources
4
 
Go read "C and Pointers" to ensure that you will solve the problem once and for all
This post is from stm32/stm8
 
Personal signature

要666

 
 

2

Posts

0

Resources
5
 
void func(u32* a){ } This is easier to understand. What is sent to the function is a pointer, which is a pointer to the u32 type.
This post is from stm32/stm8
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list