×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jul 2004
    Location
    Hellas
    Posts
    6

    Dynamic storage of names ???

    Hello everyone

    I am designing a tennis scoring system and I need to store dynamically the names of the 2 players. I have been told that I should include 2 parameters to my constructor. But I really don’t know how to do it. I have been told to try something like:

    Tennis::Tennis (TDesC& p1name, TDesC& p2name)
    {

    }

    but it doesn’t work

    Thanks for all your help
    HyacintH

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037
    Hi,

    for storing the player names define 2 member variables of type TBuf<Int n> if you will limit length of the player names to n characters or use HBufC* variables. In the second case the lenght could be determined or changed during code execution.

    You can of course pass those names as parameters in constructor of Tennis class if you know them during its construction.

    Bye

    STeN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×