• Member Avatar
    David W

    Replied To a Post in Comparing user input to a string

    If you need use a C++ vector of char, (instead of C++ strings), you might like to try something like this: // compareMyStrings.cpp // // 2017-10-09 // #include <iostream> #include …
  • Member Avatar
    David W

    Replied To a Post in Comparing user input to a string

    Declaring a number with unsigned type is the same as declaring it with unsigned int type. And note that the method .size() returns an unsigned int type. So ... when …
  • Member Avatar
    David W

    Replied To a Post in Comparing user input to a string

    Firstly, you may like to note that you mentioned using a vector of characters, but your code uses C++ strings, which is probably what you really meant to say? Also, …
  • Member Avatar
    David W

    Began Watching Comparing user input to a string

    G'day everyone! I'm fairly new to C++, so bear with me if this is painfully obvious. I'm trying to get a user to guess a string, which is just a …
  • Member Avatar
    David W

    Replied To a Post in How to call objects out of class into my main?

    Also ... in C++ you usually do NOT want redundant parameters in a class! For example, in a circle, if you know one of: radius, diameter, circumference, area you can …
  • Member Avatar
    David W

    Began Watching How to call objects out of class into my main?

    So I've been trying to make a circle class that can calculate the Area, Diameter, and Circumference of a circle. I wish to be able to do this so I …
  • Member Avatar
    David W

    Replied To a Post in Roman to Arbic Converter need help please

    Sometimes a table-lookup method is a nice way to handle problems like this. You might like to see the examples here: http://developers-heaven.net/forum/index.php/topic,134.msg709.html#msg709
  • Member Avatar
    David W

    Began Watching Roman to Arbic Converter need help please

    I am coding a roman to arabic console program for class been having issue with it I am not sure how to get the next char after the the first …
  • Member Avatar
    David W

    Replied To a Post in Hello please help me to converting C++ to C

    You may like to try someting like this to get valid input and to prevent program crashing on accidental input of an invalid type. #include <stdio.h> #define ROWS 5 #define …
  • Member Avatar
    David W

    Began Watching Hello please help me to converting C++ to C

    #include <stdio.h> int main(void) int movieChoice; int seatNum; int seatPlan[5][10] = { 0 }; int rows, cols; char space; void seatDisplay(int a[][10]); void seatNew(int n[][10]); void seatDisplay(int a[][10]) { //this …
  • Member Avatar
    David W

    Replied To a Post in string class implementation

    You seem to have two distinct parts to your project: 1) Code and test a class String 2) Use that class (and perhaps some of its methods) to process lines …
  • Member Avatar
    David W

    Began Watching string class implementation

    Hi All, I have to implement string class and write a program to perform string manipulation in Mystring class. input: "he is going to school" output Case 1: (n=1) He …
  • Member Avatar
    David W

    Replied To a Post in Calling function from another class

    Where in your code is the problem ... what lines ? What are the error messages? If you have a static method in class A you can call like this: …
  • Member Avatar
    David W

    Began Watching Calling function from another class

    Hi I am unable to call a function in one class from another class:In this line of the code it is showing error std::nth_element(edge_points.begin(), edge_points.end() - edge_points.size() * c.edge_points_percent, edge_points.end(),Camera::compare_edge_points); …
  • Member Avatar
    David W

    Replied To a Post in Problems solving loops and arrays

    @ Jemone_1 You said: > Yes I can use functions but I choose to have it working fully before I implement them You have it backwards ... well named functions …
  • Member Avatar
    David W

    Replied To a Post in Problems solving loops and arrays

    @ Dean_5, are you a Java programmer? You said: > ... C++ doesn't allow string comparison via "==" ... Please take a look at: http://www.cplusplus.com/reference/string/string/operators/
  • Member Avatar
    David W

    Began Watching Problems solving loops and arrays

    My application must let a nurse enter information for a number of patients about the patients' number of repetitions for various otherwise ordinary activities. The nurse gets a book in …
  • Member Avatar
    David W

    Replied To a Post in c++

    It is now past 17:30 EST ... and you will need to ask for an extension if you still need help with your school project ... In the future ... …
  • Member Avatar
    David W

    Began Watching c++

    HELLO, i have an project(c++) on quiz(menu based) and im in 11(cbse) i would like to have the source code with the following 1.admin menu 1.1add more ques 1.2 remove …
  • Member Avatar
    David W

    Replied To a Post in A function that takes a 4 digit integer and adds 1 to each digit in scheme

    > b. extend ... to handle input integers with an arbitrary number of digits. How do you plan to handle very long integers? Here is some C++ code that may …
  • Member Avatar
    David W

    Replied To a Post in A function that takes a 4 digit integer and adds 1 to each digit in scheme

    In Python, that easily handles for you, values of type int, to be any length, you might simply code like this: # incrementEachDigit.py # # 2016-10-28 # def takeInValid4Dig(): while …
  • Member Avatar
    David W

    Replied To a Post in A function that takes a 4 digit integer and adds 1 to each digit in scheme

    One quick way to handle this, that easily extends to 'integers' of any length, is to input your numbers as strings ... and then to code a function to increment …
  • Member Avatar
    David W

    Began Watching A function that takes a 4 digit integer and adds 1 to each digit in scheme

    **below is the problem i am given, after this i explain where i am at so far and the code i have created, **Write the following functions in Scheme: 1.a …
  • Member Avatar
    David W

    Replied To a Post in Developing a class to ease student coding crash proof and valid IO

    This discussion is useful ... maybe even a little fruitful ... and perhaps is typical of many little jobs getting their start ... starting out with a fairly simple and …
  • Member Avatar
    David W

    Replied To a Post in How do I insert A Number In a Calculator Without An Error Popping out?

    Just to confirm the ease I suggested ... you might like to see this quickly coded Python example: # findVolForSphereGivenRadius.py # # 2016-10-02 # def takeInFloat( prompt ): while True: …
  • Member Avatar
    David W

    Replied To a Post in How do I insert A Number In a Calculator Without An Error Popping out?

    Is there a clue in the Dani user name that has a `C++` in it, as in: `Linzi c++` Maybe it's some kind of generic code ? So ... to …
  • Member Avatar
    David W

    Began Watching How do I insert A Number In a Calculator Without An Error Popping out?

    I'm trying to make an interactive calculator to solve the volume of a sphere. The thing is that I can't seem to make the program let the user input their …
  • Member Avatar
    David W

    Replied To a Post in Adding to an existing binary file

    As suggested above, you seem to be a bit confuzzed? Working with C++ binary files can be a little tricky, especially at the beginning. I'm not sure what you were …
  • Member Avatar
    David W

    Began Watching Adding to an existing binary file

    I'm guessing the error lies in the writeBinary function where I open the file everytime I write into it. I am not sure how to create the file and have …
  • Member Avatar
    David W

    Replied To a Post in Developing a class to ease student coding crash proof and valid IO

    We seem to have a little communication problem here ? I am NOT at all concerned here about getting/handling any input from a file , neither by opening a file …

The End.