help with script

This is a discussion on help with script within the C Programming forums, part of the General Programming Boards category; Hello everyone. I am writing a script for school and am stuck on a certain part options like "else if ...

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    2

    Thumbs down help with script

    Hello everyone. I am writing a script for school and am stuck on a certain part



    options like "else if (memory == 2){
    printf("1536 MB Memory: %.2lf\n", memory1);
    } " do not show up when i run the program. any help would be great
    Last edited by falcons7; 09-30-2007 at 01:27 PM.

  2. #2
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    934
    Quote Originally Posted by falcons7 View Post
    options like
    Code:
    else if (memory == 2){
    printf("1536 MB Memory:                     %.2lf\n", memory1);
    }
    do not show up when i run the program. any help would be great
    I don't think you can use the "==" operator when dealing with floats and doubles, but i might be wrong... Why don't you just use an integer for the memory variable? Who is going to want 1234.567 megabytes of memory anyways?

    Also, i don't think this qualifies as a script, since C is almost always compiled, not interpreted...

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    2
    it seems to have worked... thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Script in games
    By Shakti in forum Game Programming
    Replies: 7
    Last Post: 09-27-2006, 12:27 AM
  2. In a game Engine...
    By Shamino in forum Game Programming
    Replies: 28
    Last Post: 02-19-2006, 10:30 AM
  3. how to implementate a registration script
    By TJa in forum C++ Programming
    Replies: 0
    Last Post: 10-28-2005, 02:33 AM
  4. Passing arguments to script.....
    By suwie in forum C Programming
    Replies: 5
    Last Post: 09-25-2004, 11:10 PM
  5. Game structure, any thoughts?
    By Vorok in forum Game Programming
    Replies: 2
    Last Post: 06-07-2003, 01:47 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21