Thread: ABOUT structure

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    14

    ABOUT structure

    In PASCAL:
    type screen=array[1..60,1..20] of char;

    how to write this tag in terms of C language?

  2. #2
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    869
    char screen[60][20];

    Remember that C arrays start at 0.

    Edit:

    Oh, I vaguely remember Pascal (it's been more than 15 years).. you want to make screen that type. The above declares screen to be a 60x20 char array, if you want a type:

    typedef char screen[60][20];

    Then you can do:

    screen foo;

    foo will now be a 60x20 char array.

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    14
    thanks very much for your help

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    char screen[1200];

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem referencing structure elements by pointer
    By trillianjedi in forum C Programming
    Replies: 19
    Last Post: 06-13-2008, 05:46 PM
  2. Replies: 5
    Last Post: 02-14-2006, 09:04 AM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Serial Communications in C
    By ExDigit in forum Windows Programming
    Replies: 7
    Last Post: 01-09-2002, 10:52 AM
  5. C structure within structure problem, need help
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 11-30-2001, 05:48 PM