Menu

typedef char Name[30];

2002-11-24
2012-09-26
  • Nobody/Anonymous

    Hello again, I have two questions today. If I write:

    typedef char Name[30];
    Name king[10];

    then king means 10 arrays of 30 chars (Name). How can I write a single char from king? And how can I get the king directly (in the code) not from the input?

    cin.getline(king[0], 30);//I've got king from the unformatted input

    king[0]="Kenneth";//This doesn't work

    I want to write on the screen just the first letter from the king's name. Greetings, Franjo

     
    • Nobody/Anonymous

      king[0][0] refers to the first name's first character =)

      Kip

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.