• Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in overloading operators

    Rectangle operator+ (const Rectangle& p1) { return Rectangle(width + p1.width, height + p1.height); } Breaking down this function we see the return type is a `Rectangle`. In the parameter list …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in inline function

    [Let me google that for you](http://lmgtfy.com/?q=what+is+an+accessor+and+mutator+c%2B%2B)
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in hash_map of objects

    uonsin you are only storing the name of the item. How would you retrieve the description with the method you have?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in private VS protected

    class A { public: int x; protected: int y; private: int z; }; class B : public A { // x is public // y is protected // z is …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in hash_map of objects

    You could do it that way. You could also have a function that takes an item object and returns a hash value. If you want to use standard containers then …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in private VS protected

    Making things private vs protected deal with what access inherited classes have to members. Public: everything has access to it. Protected: Only acessible from the class or classes dervied from …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Understanding Sqlite3 c++.

    The callback function is used to store the results of the query into a 2d char array. [This](http://www.sqlite.org/c3ref/exec.html) explains how to use the execute function and what the parameters are.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Understanding Sqlite3 c++.

    Did you read [this](http://www.sqlite.org/cintro.html) site? From the looks of it you need to create a connection with `sqlite3_open()` then pass that connection with a sql string to `sqlite3_prepare()` and it …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in palidrome

    @ dinad578 do not give answers to homework questions when the OP made no attempt at all to solve the problem.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in hash_map of objects

    If you want to store an object in a hash map then you need to create a hashing function that will convert the object into a hash value.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in yazılımlar

    No
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Error - String Compare

    What are you expecting it to do?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in File handling

    You are missing a `<` in between `"\t"` and `program`. Change line 19 to `cout<<name<<"\t"<<rollno<<"\t"<<program<<endl;` and you should be okay. Now all that's left to do is make your code …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Program that will ask for your full name, age , birth month and birth day

    If you name has a space in it then you need to use `getline()` and not `>>`. You need to make sure that you ["flush" the input stream](https://www.daniweb.com/software-development/cpp/threads/90228/flushing-the-input-stream) if you …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in algorithms

    So what seams to be your issue? No one is going to just answer this for you.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Sorting elements in ascending order

    No because that would be giving the OP correct code and I am not going to help he OP with there homework since the OP provided nothing but the problem …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Magick++

    Suzie I did some checking and it looks like [load_gif_external()](http://cimg.sourceforge.net/reference/structcimg__library_1_1CImgList.html#ace7c5fbf383558c31bbf08fd58807f84) uses ImageMagick or GraphicsMagick's external tools. `save_gif_external()` does not say that it does but you would think the load and …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Output decimal from binary output?

    You should be able to zip it and upload the zip file. I think .txt files are not allowed.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Output decimal from binary output?

    What is the file type?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in finding largest integer in an array

    dinad578 did you just copy rubberman's code?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Sorting elements in ascending order

    So many bad things in that code. `#include<iostream.h>` and `#include<conio.h>` are not standard. `void main()` is not standard as well. `main()` should only ever return an int. `clrscr()` is not …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Copying text.file into array of std::string object, use delimiter ‘\n’ to c

    you have vData included in multiple files so you are getting a multiple redefinition error. You can only have 1 vData in the global scope
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Copying text.file into array of std::string object, use delimiter ‘\n’ to c

    Show your source code.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in array

    You have already asked this question. Just re-posting it will not get people to do your homework for you.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Copying text.file into array of std::string object, use delimiter ‘\n’ to c

    Why are you not able to use ifstream? If this is c++ code then either fstream or ifstream is what you need to use to read data from a file. …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in string handling

    what is the number 45 21? What should the putput be when you enter 45 21?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in finding largest integer in an array

    You are running out of the bounds of the array using `i<=4` in your for loop. `if(arr[i]>(arr[i+1]))` will also run out of bounds when you are at the end of …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Output decimal from binary output?

    What does your file data look like? What should it look like after decrypting?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Passing Address of Specific Element of Dynamic Array into Function

    Have you ever worked with [iterators](http://www.cplusplus.com/reference/iterator/)? Using iterators you could do code like this. typedef vector<double> C1DArray; double sum(C1DArray::iterator it, C1DArray::iterator end) { double sum = 0; while(it++ != end) …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Difference

    AFAIK `int a = 10;` will allow the compiler to directly construct `a` with the value of 10 where as when you split it up the code still has to …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in QTextBrowser doesn´t display image from html file

    When you open the HTML document in your browser does it show the image? Where is the image located relative to the HTML document? I have not used Qt but …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Constructor

    You have a reference member (highscore) in LavaLand and that needs to be initialized upon creation. Either remove the reference or change the constructor to take in a value to …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Singleton Class

    Look at your constructor versus my constructor.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Constructor

    If you want LavaLand to have a default generated constructor then you need to get rid line 8 in LavaLand.h. You could also just change line 8 to `LavaLand() {};` …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Singleton Class

    Why is a captian a singleton? Are there not multiple captains in the world? If you want to make a singleton then you need to follow the correct syntax. Here …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in help with replacing part of char array w/ new one

    Why on earth would you return a string from this function and not take strings? A `char *` can be converted to a string so you should use strings. Does …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Inheritance: Base Class and Derived Class

    Well you can have the StoneAdventure class hold a vector of rooms and then you can declare room to be a friend of StoneAdventure.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Sorting Vector<struct> based on member

    Is it not working? It should work but I see you have the code commented out. Why is that? [Here](http://www.cplusplus.com/reference/algorithm/sort/) is a good reference for using sort.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in enum return type

    What is Error_code? Is the the enum type? Can you post your class?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in procedure and formatting regarding question anyone help me please ♥ ♥ ♥ ;-(

    Really?!? A downvote because you can't come up with an answer?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in procedure and formatting regarding question anyone help me please ♥ ♥ ♥ ;-(

    That's not going to happen. This is not a website where you post your problem and you get an answer. This is a place where you come to with questions …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Asriek display in C++/C

    There is no standard way in c++ to have an `*` replace a character while typing.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in To read a .dat file.

    Well that is pretty easy to do. You need to calls two `>>` and one call to ignore to eat the rest of the line. The folwwing is psuedo code: …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in C++11 Variable initialization with braces (Visual Studio 2012)

    You are running Visual Studio 2012 which is version 11. version 11 has little to no c++11 support. You need to go to version 2013 update 3 to get te …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in C++11 Variable initialization with braces (Visual Studio 2012)

    Are you using Visual Studio 2012? I don't know of a Visual Studio 12 unless you are talking about version 12. If you go to Help -> About you will …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in C++11 Variable initialization with braces (Visual Studio 2012)

    What compiler are you using? MSVS 2013 does not have an issue with it. Also if you want to intialize number with 4 using braces you would use `int number{4};`
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in How can I get the correct output for this C++ program?

    Move line 19 to be between lines 6 and 7.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Assignment

    What? Isn't copy and paste a skill?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in To read a .dat file.

    @ melissad - What you poseted was not c call at all. `fstream` is from the C++ STL. Not sure if you noticed but your code will run forever or …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in polynomials

    That means the the Polynomial class is going to have an array of terms the represent the polynomial.

The End.