+ 3

C- How to iterate elements in array of pointers?

int i=2; float f= 4.5f; char c[5]= "Java"; void *ptr[3]= {&i, &f, &c};

15th Jun 2021, 7:47 AM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
3 Antworten
+ 3
Hello Khairul, What did you mean by iterate? did you mean to use a loop for printing the data refered by the pointers in the array? or is it something else? Here's how I tried https://code.sololearn.com/ceb2o921zlKH/?ref=app
15th Jun 2021, 8:54 AM
Ipang
+ 4
Thanks Ipang
15th Jun 2021, 2:04 PM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
+ 2
Anytime Khairul 👌
15th Jun 2021, 2:12 PM
Ipang