Thread: Simple problem, I hope...

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    5

    Simple problem, I hope...

    Hi, I'm new to programming in general and I'm attempting to write a text based game of black jack for a bit of practice. I've just started the project and run into something weird that I really can't explain. So far all I'm doing is defining a function that creates a data structure database for each individual card and having the main function print the suit and a number value corresponding to how many "cards" are in the deck. I can't figure out why it spits back junk for cards 2 - 7 and then proceeds to print correctly. Any ideas? When it prints, it looks like this:

    Code:
    h deckValue = 1
     deckValue = 1
    \304 deckValue = -1809827132
    \206 deckValue = -1605732986
    \206 deckValue = -1605732986
     deckValue = 2139062143
    h deckValue = 32639
    h deckValue = 8
    h deckValue = 9
    h deckValue = 10
    h deckValue = 11
    h deckValue = 12
    h deckValue = 13
    d deckValue = 14
    d deckValue = 15
    d deckValue = 16
    d deckValue = 17
    d deckValue = 18
    d deckValue = 19
    d deckValue = 20
    d deckValue = 21
    d deckValue = 22
    d deckValue = 23
    d deckValue = 24
    d deckValue = 25
    d deckValue = 26
    c deckValue = 27
    c deckValue = 28
    c deckValue = 29
    c deckValue = 30
    c deckValue = 31
    c deckValue = 32
    c deckValue = 33
    c deckValue = 34
    c deckValue = 35
    c deckValue = 36
    c deckValue = 37
    c deckValue = 38
    c deckValue = 39
    s deckValue = 40
    s deckValue = 41
    s deckValue = 42
    s deckValue = 43
    s deckValue = 44
    s deckValue = 45
    s deckValue = 46
    s deckValue = 47
    s deckValue = 48
    s deckValue = 49
    s deckValue = 50
    s deckValue = 51
    s deckValue = 52
    Last edited by Polaris84; 02-24-2011 at 01:40 AM. Reason: error in print

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with piping in my simple UNIX shell
    By Integral Birth in forum C Programming
    Replies: 0
    Last Post: 11-28-2010, 07:37 PM
  2. A simple file I/O problem
    By eecoder in forum C Programming
    Replies: 10
    Last Post: 10-16-2010, 11:00 PM
  3. Simple File I/O problem
    By Ignited in forum C++ Programming
    Replies: 3
    Last Post: 01-07-2006, 10:49 AM
  4. Fairly simple problem
    By fatdunky in forum C Programming
    Replies: 1
    Last Post: 11-14-2005, 11:34 PM
  5. Bob Hope, dead at 100 of being really old
    By Govtcheez in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 07-28-2003, 08:04 AM