New to C

This is a discussion on New to C within the C++ Programming forums, part of the General Programming Boards category; Hi all, I don't want someone to do my work for me, but I study a design degree and we ...

  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,159
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,335
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,170
    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.
    For information on how to enable C++11 on your compiler, look here.
    よく聞くがいい!私は天才だからね! ^_^

Popular pages Recent additions subscribe to a feed

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