1) name is an uninitialized pointer. You have to allocate memory for it before it can be used as an input string (line 14). Just declare name as a character array instead of a pointer, such as char name[80];
line 11: There is no reason to make that variable a pointer since all you want is 10 floats. Just declare it as an array float array[10];
line 12: You can just delete this line if you make that variable an array of floats as above. In c++ programs you should use the new operator instead of malloc() or calloc().
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Kreddy89 commented: that was helpful. thank you. +0
jonsca commented: Nice +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Nick Evan commented: Nice one :) +12
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Agni commented: Nice article..!!! +3
cwarn23 commented: Great help and advice +4
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Silvershaft commented: Nice help thanks! +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Excizted commented: Useful! +1
pspwxp fan commented: do u have such an easy solution 2 everything? +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Excizted commented: Useful code snippet. +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Salem commented: Simple and obvious really :) +17
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Excizted commented: Quick, straight as always :D Thanks. +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Nick Evan commented: Sounds like a plan :) +11
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster