Search:

Type: Posts; User: nicoqwertyu

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    14
    Views
    1,971

    I feel like you can do erase(vector.begin()+n) a...

    I feel like you can do erase(vector.begin()+n) a lot of the time.

    Edit: was totally thinking of something else ::)
  2. Replies
    4
    Views
    1,841

    Elaboration on above post: #include...

    Elaboration on above post:



    #include <iostream>

    // Boring class to test list with
    class rect {
    public:
    rect() { m_width = 0; m_height = 0; }
  3. Replies
    32
    Views
    4,153

    The outcome for every student will be different...

    The outcome for every student will be different (very different); simply make sure you follow the guidelines given in the assignment. The other posters here have done a very nice job of breaking it...
  4. Replies
    32
    Views
    4,153

    Yes that's how you use a structure. Here's a...

    Yes that's how you use a structure.

    Here's a generous example.



    // <iostream> inscluded for std::cout
    #include <iostream>

    // Here we declare a structure, named rectangle
  5. Replies
    32
    Views
    4,153

    You're missing some things. Also, you're...

    You're missing some things.



    Also, you're including stdio.h, but using cout; replace <stdio.h> with <iostream>.
  6. Replies
    32
    Views
    4,153

    The book your instructor assigned knows.

    The book your instructor assigned knows.
  7. Replies
    1
    Views
    13,324

    Watch what your code is doing and you can see why...

    Watch what your code is doing and you can see why it's tweaking out. You should always try and trace what's happening, as each line of code runs, to spot where you've gone wrong.



    // This...
  8. Replies
    7
    Views
    2,403

    If you're on Linux, you should give Valgrind...

    If you're on Linux, you should give Valgrind a try.
  9. Replies
    5
    Views
    921

    Why not pass the circle, defined in main, to...

    Why not pass the circle, defined in main, to getCircleData -- similar to how you did calculateCircleData?
  10. Replies
    2
    Views
    1,390

    MinGW contains the tools Code::Blocks will use to...

    MinGW contains the tools Code::Blocks will use to create/debug/link your executables.
  11. Replies
    7
    Views
    4,731

    Ah, you're quick. Proof-read after post. Whoops.

    Ah, you're quick. Proof-read after post. Whoops.
  12. Replies
    5
    Views
    6,494

    wxWidgets is nice.

    wxWidgets is nice.
  13. Replies
    4
    Views
    1,775

    ... // I don't think you need a string...

    ...

    // I don't think you need a string reference to store the
    // city. I _believe_ that a copy is returned.
    void getCity(string line, string& city)
    // string getCity(string line) {
    {
    // If...
  14. Replies
    4
    Views
    1,775

    Here's a little help, but I have to run to the...

    Here's a little help, but I have to run to the DMV so I can't look through it much more this morning



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

    using namespace std;
  15. Replies
    29
    Views
    11,182

    #include int main(int argc, char*...

    #include <string>

    int main(int argc, char* argv[]) {
    std::string mystring = "Hello, World!";

    return 0;
    }


    Is the same as:
  16. Replies
    3
    Views
    1,197

    What does buildArray do? All you've given is a...

    What does buildArray do? All you've given is a function declaration.



    void printArrays (int family[], int item[], int quantity [], double price[])
    {
    int i;...
  17. You don't simply want to replace srand with rand:...

    You don't simply want to replace srand with rand: you want to use both.

    As MK27 stated, you call srand once to seed the random number generator, then use rand in your
    loop to get your random ...
  18. 1.) You're trying to access a pointer that points...

    1.) You're trying to access a pointer that points to garbage.

    hired[lastused] = new Hired(int);

    2.) Don't try to call a constructor explicitally, it's called upon "construction." To call the...
  19. Replies
    14
    Views
    2,873

    You're still including *.cpp files, and you...

    You're still including *.cpp files, and you shouldn't be.
    book.h is including itself, and it shouldn't be.
    There is an include outside of ISBN.h's include gaurds, and there shouldn't be.
    ISBN.h is...
  20. Replies
    3
    Views
    13,302

    Give this a look-through: it's pretty good...

    Give this a look-through: it's pretty good
  21. Something like this... I'm sure someone will come...

    Something like this... I'm sure someone will come in after me to put in their corrections.

    In a linked list, each node contains a pointer to the node created after it -- except that last node,...
  22. Replies
    8
    Views
    4,027

    Am I getting warmer? enum { STATE_IDLE,...

    Am I getting warmer?



    enum {
    STATE_IDLE,
    STATE_CONNECTING,
    STATE_CONNECTED,
    STATE_DISCONNECTING,
    };
  23. Replies
    6
    Views
    1,525

    #include #include ...

    #include <iostream>
    #include <vector>

    std::vector<monster> monsters;

    void AddMonster(int hps) {
    monster m;
    m.m_hps = hps;

    monsters.push_back(m);
  24. FunctionNameThatGoesThroughAFileAndOutputsAllLines...

    FunctionNameThatGoesThroughAFileAndOutputsAllLinesStartingWithALetterToASeparateFile(var infilename, var letter, var outfilename) {
    var InFile
    var Line
    var Vector
    var OutFile

    InFile =...
  25. Replies
    1
    Views
    929

    You can always use fileName.c_str(). It will...

    You can always use fileName.c_str(). It will return a const char*, I believe.
Results 1 to 25 of 40
Page 1 of 2 1 2