The first example should use 100% of the CPU while it is processing the for loop then it should sleep for 10 ms and start all over again. The second loop has the "Sleep()" function inside of the only loop so it is sleeping at every iteration.
The function "Sleep()" tells the scheduler to defer to another process in the queue for how ever long you pass it. During this time the thread that calls "Sleep()" is not occupying the CPU processing power.
Obviously you don't know or you wouldn't have been asking about it. There is several things you did wrong in your code. I'm just going to point them out but won't tell you how to fix them because it looks like global hooks.
1) Infinite loop
2) Loop nested within infinite loop
3) For loop goes out of bounds (should result in a compiler error)
4) Character arrays are old school and pointless. You're also not even doing anything with them.
5) Your functions make no use of args
6) You're assigning a potentially undefined element from one array to another.