Such a newb at this... need some help

This is a discussion on Such a newb at this... need some help within the C++ Programming forums, part of the General Programming Boards category; I haven't programmed C in years. I used to program BASIC pretty well, but that's been a while as well. ...

  1. #1
    Programming n00b mdphoenix's Avatar
    Join Date
    Dec 2005
    Location
    Perry Hall, MD
    Posts
    2

    Unhappy Such a newb at this... need some help

    I haven't programmed C in years. I used to program BASIC pretty well, but that's been a while as well. I need to do something simple, and I've asked a few people on an auto forum I'm on if they could do it for me. No one has taken the task. So it looks like I need to get back into this so I can accomplish the task myself. Who knows, this could be good for me, right?

    I need to query the CPU for the CPU-ID string "name string" and display it. BUT, I need it to happen in DOS. As in, booting to a bootable floppy.

    Problem is... I don't know where to start. I don't remember how to even START a C program.

    Any help?

  2. #2
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    get a compiler.
    prehaps DevC++
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    This is the C++ forum.

    Dev-C++.

    BUT, I need it to happen in DOS. As in, booting to a bootable floppy.
    Are you sure? Usually the "DOS" found in Start->Run->"cmd"/"command" will work just fine. Or you can run your programs straight from Dev-C++.

    Download Dev-C++ and try this sample program:
    Code:
    #include <stdio.h>
    
    int main(void) {
        printf("Hello, World!\n");
        getchar();
        return 0;
    }
    I need to query the CPU for the CPU-ID string "name string" and display it.
    The CPU? Never mind. Try this program:
    Code:
    #include <stdio.h>
    
    int main(void) {
        char name[80];
        printf("Enter your name: ");
        fgets(name, sizeof(name), stdin);
        printf("Hello, %s", name);
        return 0;
    }
    (That leaves the newline on name, but it should give you a general idea.)
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    Programming n00b mdphoenix's Avatar
    Join Date
    Dec 2005
    Location
    Perry Hall, MD
    Posts
    2
    Yes, I'm absolutely sure I mean DOS. As in, booting to a floppy with IO.SYS, MSDOS.SYS and COMMAND.COM on it.

    I have Borland C++ 5. Will that make a DOS executable once I get this right?

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    Just try it in the command prompt. I bet it will work.

    I have Borland C++ 5. Will that make a DOS executable once I get this right?
    It will run under the command prompt.

    Try copying my first program. Save it and compile it, and it should run.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newb Question Character Counting
    By Wilder in forum C Programming
    Replies: 13
    Last Post: 06-23-2008, 12:37 AM
  2. Dogpile the newb!
    By lindy in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 05-23-2008, 09:17 AM
  3. Total newb directx invisable geometry question
    By -pete- in forum Game Programming
    Replies: 5
    Last Post: 08-13-2006, 02:45 PM
  4. Newb C++ Programmer
    By Philandrew in forum C++ Programming
    Replies: 8
    Last Post: 10-19-2004, 09:44 PM
  5. if your not newb you can help me
    By Klinerr1 in forum C++ Programming
    Replies: 6
    Last Post: 05-05-2002, 01:09 AM

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