Where am I converting char to int??

Sharky Forums


Results 1 to 4 of 4

Thread: Where am I converting char to int??

  1. #1
    Reef Shark
    Join Date
    May 2001
    Location
    Florida
    Posts
    421

    Where am I converting char to int??

    Nevermind... I was dumb :-p
    Last edited by Handyman; 04-03-2003 at 12:16 AM.
    | Processor | Intel Pentium 4 @ 2800 MHz | Motherboard | ABIT IC7-Max3 | Memory | 2 GB Corsair XMS PC3200 DDR | Graphics | ATI Radeon 9800 Pro | OS/Prog HDD | W.D. Raptor 36GB (10k) SATA | Storage HDD | Seagate 160GB (7200) SATA | Burner | Lite-On 52x24x52 CDRW | DVD-ROM | Lite-On 16x DVD | Sound Card | Philips Acoustic Edge | Speakers | Klipsch ProMedia 2.1 | Flash Media | Lian-Li Flash Media Bay | Display | Dual NEC 22" Flat CRT | Case/PSU | Lian-Li PC-65B w/ Antec 430W | O.S. | MS Windows XP Pro | Printer | Epson Stylus Photo 2200

  2. #2
    Hammerhead Shark Big_Mac's Avatar
    Join Date
    Feb 2003
    Location
    Windsor, Onatrio, CANADA
    Posts
    1,672
    And just for all the others that are doing C code, and that might need the reminder, char = int. A character is stored as it's numerical value in whatever standard you compile with. Normally, that means that characters are stored as an int with the value of the character's ascii number.

    so, char=int for storage purposes...
    Originally posted by Ferrett
    I'M SORRY. There were hot girls. I got distracted.

  3. #3
    Tiger Shark
    Join Date
    Oct 2000
    Location
    Erie, PA, USA
    Posts
    693
    Actually in most C implementations, a char is stored as a byte and an int is store as 2 bytes. So char isn't quite the same thing as int.
    AMD AthlonXP 2600+ Thoroughbred B @ 200x10.5
    Shuttle AN35N nForce2 Ultra 400
    2x512MB Kingston PC3200 (3-3-3)
    ATI Radeon 9600 Pro
    40GB WD ATA-100 8MB cache
    Creative 12X DVD Drive
    Memorex 52X CD-RW
    Running Windows XP Pro

  4. #4
    Hammerhead Shark EverlastingGod's Avatar
    Join Date
    Feb 2003
    Location
    MD
    Posts
    1,364
    I think most C implementations are up to 4 bytes for an int now.
    Stay cool
    and be somebody's fool this year

Posting Permissions

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