orCode:printf("\n\n\t\t1st Player:"); scan("CLAN[%d]",&CLAN[10]);
Code:printf("\n\n\t\t1st Player:"); scan("%d",&CLAN[10]);
This is a discussion on is this array possible? within the C++ Programming forums, part of the General Programming Boards category; Code: printf("\n\n\t\t1st Player:"); scan("CLAN[%d]",&CLAN[10]); or Code: printf("\n\n\t\t1st Player:"); scan("%d",&CLAN[10]);...
orCode:printf("\n\n\t\t1st Player:"); scan("CLAN[%d]",&CLAN[10]);
Code:printf("\n\n\t\t1st Player:"); scan("%d",&CLAN[10]);
it has to be scanf not scanOriginally Posted by Marrah_janine
both are possible
in the 1st case, there has to be this input from the player:
CLAN[43]
where 43 is some kind of a number.
in the second case, the user has to write
43
the same deal with the 43 again
the stuff that you write in the "" is the form of data that the scanf function has to read - if you try to do memory allocation in it or anything else, it won't work, because scanf doesn't care about it - it only cares about the %d and %f and so on...
and this is a C++ programming board. Your current code is in C, so please don't post in the wrong subforum again![]()
CLAN should be an array with at least 11 elements
If I have eight hours for cutting wood, I spend six sharpening my axe.