Thread: New to C

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    1

    New to C

    Hi all, I don't want someone to do my work for me, but I study a design degree and we have one project using C that I'm struggling with. I have completed lots of tutorials and done simple programs, but even with all the information I don't know where to start.

    We have to make a program that navigates around a floor plan of our own home, so the screen would read:

    Welcome to .... house click N, S, E, W to move around, so once you press N you would go into the house etc.

    I don't understand how to take all the tutorials and convert it into this

    Anyone who could tell me what to even start thinking about, it would be much appreciated, I don't want the code, cause I would like to learn but maybe some guidance of what to even use or where to start.

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Maybe a Room class with some basics like a name (e.g. Kitchen). The class would also probably contain N,S,E,W pointers to other Room objects. For example, Kitchen's West field might contain a pointer to the Living Room object.
    If you understand what you're doing, you're not learning anything.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    See my reply in this thread, for the basic idea.
    Using a huge 3D array
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    You say you are new to C. Yet, you are posting in the C++ forum. Why?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed