-2

I'm trying to generate a random number between 0 and 3 by saying

int i = arc4Random() % 3;

but it keeps giving me the warning "implicit declaration of function 'arc4Random' is invalid in c99

user2864740
  • 60,010
  • 15
  • 145
  • 220
Aeisys
  • 367
  • 1
  • 3
  • 13

2 Answers2

2

Try it without the capital r

int i = arc4random() % 3;
Mike
  • 9,765
  • 5
  • 34
  • 59
2

You have a capital "R" in arc4Random. Should be: int i = arc4random % 3;.

Tanner
  • 176
  • 1
  • 5