scanf() expects the prameters to be pointers so that it can change the variables values. num is just an integer, not a pointer, so put the & pointer operator in front of it.
count = scanf ( "%s%n", phone, &num );
Also see this article about %n.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343