• Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Getting started with SQL/C++

    @rubberman Microsoft does offer an express version of MS SQL Server that is free. I am looking at that right now for some time and attendance software that needs a …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Please help me make effecient this source code!

    Now if he offered to pay for this that would be a different story. I don't know about the rest of you but I think if the OP offered $1000 …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Using square root in dev C++

    Please don't resurrect dead threads that have already been answered.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in C++ FAQ

    Just another person hoping that the internet is the answer to all of lives problems.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in C++ stack

    If our output should be: Popping...a Popping...b Popping...c Popping...d Popping...e Popping...f Then you need to be storing a,b,c,d,e and f in your stack. right now you are storing 1,2,3,4 and …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Keep it Hot! The secret to high-performance code

    Argh. Thanks fo spotting the typo.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Keep it Hot! The secret to high-performance code

    What a great post Mikael. I never though about sorting derived objects in the container so that the same function keeps getting called. I would suppose this would also help …
  • Member Avatar for NathanOliver
    NathanOliver

    Gave Reputation to mike_2000_17 in Keep it Hot! The secret to high-performance code

    This tutorial is the first time I write about coding techniques for improving the performance of software. This is going to be a step-by-step journey through a real example, with …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in calculation

    @ddanbe: A char is an integer type so it can be implicitly converted to an int. Since `sizeof(char) <= sizeof(int)` there is no loss of precision. C++ uses 5.2.4.2.1 from …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in c++ static member

    You have to initialize the map. Take a look at [this](http://stackoverflow.com/a/13464363/4342498) post As how you can do that with or without C++11 support.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in c++ static member

    You have to initialize the static member outside of the class. /Foo.h class Foo { static int bar; //... }; // Foo.cpp int Foo::bar = 1; If the initialization is …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in adding even numbers in a given Range

    1) Open program to write code 2) Write code 3) Compile code 4) If you have errors fix them and go to step 3 else continue 5) Run code and …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in area of circle

    Move lines 25-32 to be before `main()`
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in area of circle

    You would create a function like what I have shown. Then instead of having lines 27-31 you would just call that function passing the array.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in continue(y/n) problem?

    The problem is that `cin.get(response);` is leaving an `'\n'` in the buffer so when you call `cin.get(c);` at the beginning of the loop it pulls in the `'\n'`. Since `'\n'` …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Output the smallest

    Doing a linear search through a list or an array to find the minimum is O(N) or linear time. If you were to sort and then grab the first element …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in area of circle

    You need to have a void function that displays the area of the circles in the array. It should be like void DisplayArea(Circle[NUM_CIRCLES] circles) { for (int index = 0; …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in does anyone remember how to make the diamond pattern in c++?

    @Zee Khan - Start a new thread, don't resurrect a 6 year old thread. You should try to see if you can do it first and then if it doesn't …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in c++ cashier

    Start a new thread and post the code that you have and the problem it is having.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Understanding Copy Constructor.

    I have to add that if you have a C++ 11 compiler then you should be using `nullptr`.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in sorting array

    What is the value of count when you exit `for (; x <= userMax;)`?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Output the smallest

    What part are you having trouble with?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Output the smallest

    @phony You need to do the check while you are getting the input from the user. Otherwise you need to iterate through the contents of `intList` and find the smallest …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Output the smallest

    Compare each element entered by the user to the previous input. If the number is smaller then set it to min. Otherwise keep the min you already have. Since you …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in C++ FSTREAM Problem

    backslashes should be `\\` since `\` is an escape character. Try: infile.open("C:\\Projects\\C++\\infile.txt"); outfile.open("C:\\Projects\\C++\\outfile.txt");
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in how overload != and == operators?

    `haveimage()` returns true or false so if `haveimage()` returns true then `if(inst->imgtest.haveimage())` becomes `if(true)` and the body of the if statement is executed. If it were false then `if(inst->imgtest.haveimage())` becomes …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in how overload != and == operators?

    You wouldn't have to write if(inst->imgtest.haveimage()==true) That could be expressed as if(inst->imgtest.haveimage()) When using an IDE that has auto-complete it is even faster to write. I also want to stress …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Need a c++ programe

    Sounds like this is something you should do yourself. If you have code and you are having problems with it then post the code you have and what problem you …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in how overload != and == operators?

    Well if the default construction of an image leaves the image in an invalid state you could use: if(inst->imgtest != image()) this will test `imgtest` against an default object. As …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in change

    Go through the string and change each letter to uppercase. You can use [toupper()](http://www.cplusplus.com/reference/cctype/toupper/) to make life easy.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in how overload != and == operators?

    Is `imgtest` a pointer? I am guessing it is not because of the error : "ambiguous overload for 'operator!=' (operand types are 'image' and 'int')" If a type is not …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Converting int to double

    To get a double one of the numbers needs to become a floating point number so the compiler knows to do floating point math. bmi = static_cast<double> (703 * weight …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in unexpected end-of-file & missing function header (old-style formal list?)

    `main()` needs to be moved from line 105 to line 6. It should also be `int main()`. `main()` should always return an `int`. You also need to get rid of …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Simple Math C++ questions/double checking

    What happens if you run the code? I can tell you `5%3` is 2 not 1. `%` works as `5 - ((5/3) * 3)` or `a%b = a - ((a/b) …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Win32 Edit - how to display std::string

    @search_not I made a mistake in the corrected for loop. The code should be for(unsigned i = 0; i < data->size(); i++){ appendTextToEdit(hEdit, (data->at(i)).c_str()); } That way you dont have …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Win32 Edit - how to display std::string

    You need to use `L` before string literals now that you are using `wstrings` for lines 2-5. Your for loop that is giving you your second error: for(unsigned i = …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Win32 Edit - how to display std::string

    Can you post the code that is giving you the problem?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Win32 Edit - how to display std::string

    What is the type of `read_in`? If it an `ifstream` you need to make it `wifstream`. If you are going to write a program that supports unicode then you should …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in smaller allocation size - struct access

    Yes.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in smaller allocation size - struct access

    You are playing with undefined behavior. You should never go past the end of an array. Just because it worked doesn't mean it will always work. What you actually did …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Win32 Edit - how to display std::string

    Why not use `std::wstring` instead of `std::string`. Then you can call `std::wstring.c_str()` which will give you an `wchar_t*`.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in design a stack using c++ in object oriented programming fashion

    Are you having an issue with your code are are you just showing us it? If you are having a problem explain what it is. If you are having compiler …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in ali asad

    Is the power cord plugged in? Is the power turned on?
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in counting numbers

    @ Nimra_1 1) Dont post your own question in a different thread. 2) We dont do homework for others 3) Read the [Rules](https://www.daniweb.com/community/rules)
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in file operation

    It would only be fair. Unless he wants to pay for the work to be done. I'll offer my services for $250 USD per hour.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in File handling

    When you write `FILE *out , *in` you can be translated to `FILE *out; FILE* *in`. When using `,` in a function call it is used to separate the paramaters …
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in there was a problem starting C:\PROGRA~3\9EEDE77.ccp the specified module c

    Which means it is a program that loads on startup. That still doesn't changethe fact that it is not working.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in there was a problem starting C:\PROGRA~3\9EEDE77.ccp the specified module c

    Navigate to the folder location the error gave you. progra~3 would be something like program files, program files(x86), program data.
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in date

    There is an entire standard header file full of functions to do this. Check out [ctime](http://www.cplusplus.com/reference/ctime/).
  • Member Avatar for NathanOliver
    NathanOliver

    Replied To a Post in Input Buffer

    The jist of the issue is `>>` leaves the "enter key" in the input buffer. If you don't remove it before `getline()` is used then `getline()` will see the "enter …

The End.