Search:

Type: Posts; User: The Doctor

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    1,647

    #include #include ...

    #include <iostream>
    #include <fstream>
    #include <iomanip>
    #include <string>

    using namespace std;

    void getdata(char name[], double &gpa)

    {
  2. Replies
    9
    Views
    1,647

    Policy on this forum is that the user should...

    Policy on this forum is that the user should attempt their homework before asking for help.

    Please try to do it yourself, and if you have any questions, feel free to ask for help.

    We will not...
  3. Thread: Suggestion

    by The Doctor
    Replies
    5
    Views
    1,220

    http://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&...

    http://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CDoQFjAB&url=http%3A%2F%2Foopd-assignment.googlecode.com%2Ffiles%2FOOPD110Book%282%29.pdf&ei=0NCiUZy6MuPniAeszoFY&usg=AFQ...
  4. Thread: .h & .lib

    by The Doctor
    Replies
    7
    Views
    1,005

    I am not familiar with .lib files, but a .h file...

    I am not familiar with .lib files, but a .h file should contain the declarations of certain functions. Use these functions in your program to achieve the result you need.

    perhaps the .lib file is...
  5. Replies
    11
    Views
    1,457

    They aren't variables, they're custom Data types....

    They aren't variables, they're custom Data types. ( they're structs, and I've used typedef so I don't have to type struct Instruction everywhere).

    I first learned to program in Java, so I like...
  6. Replies
    11
    Views
    1,457

    Hey guys, is there an easy way in gdb, to keep...

    Hey guys, is there an easy way in gdb, to keep track on the value of one particular instance of a struct?

    Even if I could keep track of each instance of the struct at all points it is accessed...
  7. Replies
    11
    Views
    1,457

    This is part of a Uni assignment, and the coding...

    This is part of a Uni assignment, and the coding style I was taught was to cast it back to the specific type anyway, so that's the style I will follow. ;)

    Boy is this bug annoying... You really...
  8. Replies
    11
    Views
    1,457

    integer in struct equals zero later.

    /*
    * Instruction_t - stores a specific instruction
    */
    typedef struct
    {
    /*
    * action - CPU or IO
    */
    Action_t action;
  9. My advice on looking up char arrays still holds...

    My advice on looking up char arrays still holds though.
  10. We won't do your homework for you, mate. That...

    We won't do your homework for you, mate. That wouldn't help you in the long run.

    I'll give you a hint: Character strings are implemented as char arrays in C. That might be what you need to know.
    ...
  11. Replies
    3
    Views
    4,081

    I tried to compile your code (removing line 37)...

    I tried to compile your code (removing line 37) and it compiled. It just didn't remove the vowels.

    I suspect your use of some of the string functions is wrong. Perhaps you should look up how those...
  12. Replies
    3
    Views
    4,081

    Line 37. enteredword = word; Is there any...

    Line 37.
    enteredword = word;

    Is there any reason you need that? Unless I'm mistaken that line sets "enteredword" equal to a variable called "word", which does not exist in that scope (the...
  13. Ummm.... A couple of points: 1. Divide the...

    Ummm....

    A couple of points:

    1. Divide the program into modules. Use functions (subroutines) to eliminate having to write the same thing over and over again. Consider using classes if you know...
  14. Replies
    8
    Views
    1,773

    Look up Preprocessor commands. That's what you...

    Look up Preprocessor commands. That's what you need to use.

    You want the volume thing to not be a function. you need to use #define for a macro as well.
  15. Okay, I've adjusted the code further... The only...

    Okay, I've adjusted the code further... The only preprocessor constant left is VERSION, as I saw no need to put that in the Grid class.

    I'm tempted to put them in a separate class of themselves,...
  16. Sorry for the double post, but here's V1.4 if...

    Sorry for the double post, but here's V1.4 if anyone's interested:

    Main.cpp:


    #include <iostream>
    #include "grid.hpp"

    using namespace std;
  17. Thanks to both laserlight and whiteflags. The...

    Thanks to both laserlight and whiteflags. The code is working a lot better now.

    This is the first I've heard of "const correctness", I guess I'm going to have to do some research on that too. I...
  18. Thanks for the advice. I might fiddle around with...

    Thanks for the advice. I might fiddle around with the program later.

    As I indicated in my post, I'm coming from a Java background, and so some of the concepts in C++ are new to me.

    I have heard...
  19. boxes is declared as boxes = new...

    boxes is declared as


    boxes = new char[8];

    EDIT: Hang on a minute????? I declared it as only having 8 characters, and yet it seems to still be working fine! I'll go and fix that now...
  20. Critique my TicTacToe game (terminal-based)

    I kind of wanted to brag about my first real C++ program. I know it's simple, but I just am really happy about it.

    While you're looking at it, if you see something I could have done better, please...
  21. Replies
    1
    Views
    3,191

    Oh man, I feel so stupid! I just realized that...

    Oh man, I feel so stupid!

    I just realized that I should have been &&'ing rather than ||'ing on line 14. *FACEPALM*
  22. Replies
    1
    Views
    3,191

    bool function always seems to return true

    Greetings, you may know me from my posting in the C Forums.

    Having basic knowledge in Java, and thus a basic knowledge in Object Orientation, I decided to give C++ a go.

    I decided to make a...
  23. Replies
    8
    Views
    4,829

    Can you explain why it is evil? I don't see a...

    Can you explain why it is evil? I don't see a problem with it. (Though I am admittedly new to C)
  24. Just compiled on another computer, and it...

    Just compiled on another computer, and it compiled fine. There might be something wrong with my math library. Any suggestions on how to fix it?

    Also, I actually don't have a LDFLAGS variable......
  25. Why haven't I needed to do that so far? And could...

    Why haven't I needed to do that so far? And could I do that in the Makefile?

    EDIT: I added that to my $(CFLAGS) variable in the makefile, and it still comes up with the same error.

    Here's my...
Results 1 to 25 of 50
Page 1 of 2 1 2