+1

Array

#include <stdio.h> #include <stdlib.h> int  main() { int i, arr[5] = {25, 30, 35, 40, 55}; for( i=0; i<5; i++) { printf("%d   ", *arr); arr++; /* 'main':| 9|error: lvalue required as increment operand| */ } return 0; }

10/20/2019 8:13:01 AM

simi sam

9 Answers

New Answer

+4

arr is an array of 5 int not a pointer. You cannot increment an array like that. If you want to print data using pointers then do this int *ptr = arr; printf("%d ", *ptr); ptr++; You can directly write *p++

+3

simi sam You are Welcome 👍☺ And I am fine without 'sir'

+2

simi sam Sololearn certificates are not yet valid. It is given just given as a proof for completion of course

+1

Thank you sir

+1

Ok thanks

0

Is it a valid certificate for interviews by going through solo learn

0

Could you answer

0

Do I need certification simi sam Please, Use the 🔍SEARCH... bar future! https://www.sololearn.com/Discuss/532576/?ref=app https://www.sololearn.com/Discuss/1063546/?ref=app

0

As you have done in solo learn