• Member Avatar for David W
    David W

    Began Watching I need help with string

    Here is question: Write a program that reads a string from the user containing a date in the form mm/dd/yyyy. It should print the date in the form March 12, …
  • Member Avatar for David W
    David W

    Replied To a Post in I need help with string

    And ... you could also ... simply do input like this: // monthDayYear.cpp // #include <iostream> #include <string> using namespace std; int main() { int mon; int day; int year; …
  • Member Avatar for David W
    David W

    Replied To a Post in conditional if statements

    Look here for some more ideas about getting input ... [Click Here](http://developers-heaven.net/forum/index.php/topic,2019.0.html) Do you see the code option ... use that to submit code to preserve the indentation #include <iostream> …
  • Member Avatar for David W
    David W

    Began Watching Multiple data in a queue

    I want to create a queue that holds certain information. I want it to hold multiple peices of information like below. Name, Age, Race, Sex. How can i create a …
  • Member Avatar for David W
    David W

    Replied To a Post in Multiple data in a queue

    Use a struct and the C++ STL queue to hold those data structs
  • Member Avatar for David W
    David W

    Began Watching How to queue into a class

    I have a class below class CPU { public: void setPID (int a) { PID = a; } int retrievePID() { return PID; } private: int PID; }; And i …
  • Member Avatar for David W
    David W

    Replied To a Post in How to queue into a class

    A queue ... is just a first in ... first out (FIFO) data structure ... What are you trying to do with a queue ... C++ has one in the …
  • Member Avatar for David W
    David W

    Began Watching conditional if statements

    Write a program to get 3 numbers from user for integer variable a, b,and c. if a is not zero, find out whether it is the common divisor of b …
  • Member Avatar for David W
    David W

    Replied To a Post in conditional if statements

    Do you know how to code a 'Hello World' C++ program? Do you know how to get integer user input (using cin) with a prompt for input? Do you know …
  • Member Avatar for David W
    David W

    Began Watching Checkbook program

    I need some assistance with a program I wrote and had to alter. Here are the initial instructions and what I initially had then my reworking and what I have …
  • Member Avatar for David W
    David W

    Replied To a Post in Checkbook program

    > If the account balance falls below $800.00 at any time during the month, there is a $5.00 service charge for the month. This fee is only charged ONCE per …
  • Member Avatar for David W
    David W

    Began Watching Allow only positive integers

    How can i write it so that my program only accepts positive integers that are great than or = 0? I want my program to ask "How many devices do …
  • Member Avatar for David W
    David W

    Replied To a Post in Allow only positive integers

    //NOTE Oops ... unsigned value; cout << "Please enter a positive number: "; while (!(cin >> value) || value < 0) // Oops value is 'unsigned' so will never be …
  • Member Avatar for David W
    David W

    Began Watching cin string doesnt work?

    I am getting an error on this code. Is it to do with whats in the while loop? How do i get it working? Basically i want to be able …
  • Member Avatar for David W
    David W

    Replied To a Post in cin string doesnt work?

    Yes ... you are correct ... A string has: string s = "message"; A char has: char c = '!'; #include <string> // ... int main() { std::string input = …
  • Member Avatar for David W
    David W

    Began Watching Allow only letter inputs.

    How can i create a input that only allows the letters a b c d The console will ask to please enter a letter. And they can only enter the …
  • Member Avatar for David W
    David W

    Replied To a Post in Allow only letter inputs.

    This next link may also give you some ideas for input in a loop ... Note the steps. [6 Steps](http://developers-heaven.net/forum/index.php/topic,2019.0.html)
  • Member Avatar for David W
    David W

    Replied To a Post in Corrections Turbo C++ Conversion

    Here is my 'OLD Borland' Turbo compiler output ... (after I removed the initial assignment of a 0 value ... that 'Turbo' didn't appreciate ... but ... it only issued …
  • Member Avatar for David W
    David W

    Replied To a Post in passing double arrays to functions

    Here is some of my really old code ... that I found, and quickly cleaned up a little, so it would compile ok ... under C90 ... It that may …
  • Member Avatar for David W
    David W

    Began Watching passing double arrays to functions

    Hi there, I am having a problem of passing arrays to functions, here is my code: void zeroMatrix(float **arr); void main() { float e[2][2]; zeroMatrix(e); } void zeroMatrix(float** arr) { …
  • Member Avatar for David W
    David W

    Replied To a Post in passing double arrays to functions

    [Check this link](http://www.daniweb.com/software-development/c/threads/474166/column-major-not-shown-right)
  • Member Avatar for David W
    David W

    Began Watching How to use single client.h for multiple c program

    Hi All, I am new to c programming. I have mulptiple c files which uses the client.h Currently I am using my header file in each and every place where …
  • Member Avatar for David W
    David W

    Replied To a Post in How to use single client.h for multiple c program

    Yes ... you can have a file to be included ... that is just a list of other file 'includes' ... that you need included. Make sure that you have …
  • Member Avatar for David W
    David W

    Began Watching Parsing my command from input

    I was having a little trouble with parsing my command upon input, I'm new to C so any help would be greatful! Here is what i have so far i'm …
  • Member Avatar for David W
    David W

    Replied To a Post in Parsing my command from input

    You might like to look at split.h ... that emulates the Python split function in C A C string input, with the delimiters, returns a Clist of 'words' (dynamic C …
  • Member Avatar for David W
    David W

    Replied To a Post in Corrections Turbo C++ Conversion

    @Schol-R-LEA ... thanks for the AStyle indenting link. Just for the fun of it, I revised my above version that used fgets ... so that it NOW ... ONLY USES …
  • Member Avatar for David W
    David W

    Replied To a Post in Need help with C-strings/Library program

    You may also like to see using strchr ... the C string version of finding a char in a C type string? Note the use of 'pointer arithmetic', when using …
  • Member Avatar for David W
    David W

    Began Watching Converting string into uppercase

    dear friends, I am a beginner in c programming and I have learned the c++, java as well, In C I have been asked for a question about how to …
  • Member Avatar for David W
    David W

    Replied To a Post in Converting string into uppercase

    If you write a small program to loop through all the char's a..z and A..Z and take the difference of each matching pair ... the results may give you a …
  • Member Avatar for David W
    David W

    Replied To a Post in parallel arrays and putting them into a file

    Here is a common 'show data' example ... that may help you to get started ... ( Oops ... looks like I missed the post just now of Dani's 'Ancient …
  • Member Avatar for David W
    David W

    Replied To a Post in parallel arrays and putting them into a file

    Will you be reading back from file to fill arrays?
  • Member Avatar for David W
    David W

    Began Watching parallel arrays and putting them into a file

    I have to take two arrays, put them in a function, and then put them into a file. I have no problem actually making the arrays, but I am not …
  • Member Avatar for David W
    David W

    Replied To a Post in parallel arrays and putting them into a file

    It looks like you have 6 companies ... And sales for 4 periods for each company ? This lends itself to a (data) struct using ONE array of struct (or …
  • Member Avatar for David W
    David W

    Replied To a Post in Need help with C-strings/Library program

    Take a look at this simple example ... /* findCharInString.cpp */ /* ... say for example if I have the string: "I like to program" and if I wanted to …
  • Member Avatar for David W
    David W

    Replied To a Post in Need help with C-strings/Library program

    Take a look at this simple example ... /* findCharInString.cpp */ /* ... say for example if I have the string: "I like to program" and if I wanted to …
  • Member Avatar for David W
    David W

    Replied To a Post in Corrections Turbo C++ Conversion

    Oops ... just noticed above, don't need to take tolower in the switch ... as added both lower and upper cases ... so that now each selection has two cases …
  • Member Avatar for David W
    David W

    Replied To a Post in What's wrong with my code?

    Hey ... always so nice to hear back from a 'happy coder'. Enjoy your code! You may be spending SO MUCH time coding ... or trying to figure out some …
  • Member Avatar for David W
    David W

    Began Watching How to Fix These Errors

    I tried fixing these errors but to no avail. Can someone please explain to me what I need to do to fix them? #include <iostream> using namespace std; int main() …
  • Member Avatar for David W
    David W

    Replied To a Post in How to Fix These Errors

    This may be what you were looking for ? #include <iostream> using namespace std; int const ROWS = 2; int const COLS = 3; void print( int a[][ROWS][COLS], int numTables …
  • Member Avatar for David W
    David W

    Began Watching QUESTION

    i have a question is there line of code or any code that restricts the user from inputting any letter or number or any key to my choice, but in …
  • Member Avatar for David W
    David W

    Replied To a Post in QUESTION

    I think what you are looking for is 'error handling' for input of 'invalid data' ... so that your running program will NOT then crash ... when the user enters …
  • Member Avatar for David W
    David W

    Began Watching determining whether a string of parentheses is balanced or not

    i can't fix my errors. please help me out... here's the ITEMTYPE part of my code: //itemtype.h::::: #ifndef ITEMTYPE_H_INCLUDED #define ITEMTYPE_H_INCLUDED class itemtype public: itemtype(); void print()const; void initialize(int number); …
  • Member Avatar for David W
    David W

    Replied To a Post in determining whether a string of parentheses is balanced or not

    This related example may help ... may give you some ideas ? // classStack.cpp // #define MAX_ITEMS 50 template < typename T > class Stack { public: Stack(); bool isEmpty() …
  • Member Avatar for David W
    David W

    Replied To a Post in Corrections Turbo C++ Conversion

    Ok ... this uses fgets ... (it's just an edited alternate version -> for your added benefit <- of the clean coding, already supplied to you, by Dani Virtuoso ... …
  • Member Avatar for David W
    David W

    Began Watching Array

    how can we pass the value of an array without using index of an array i.e subscript([]).
  • Member Avatar for David W
    David W

    Replied To a Post in Array

    Pass a pointer
  • Member Avatar for David W
    David W

    Replied To a Post in Corrections Turbo C++ Conversion

    Re ... char (C++ string) input ... Did you ever think to look here ? [LOOK Here](http://www.daniweb.com/software-development/cpp/threads/474501/base-conversions)
  • Member Avatar for David W
    David W

    Replied To a Post in Corrections Turbo C++ Conversion

    This was the output I got of the code I sent you: > Conversion from any base to base 10 > a - Binary > b - Octal > c …
  • Member Avatar for David W
    David W

    Replied To a Post in Base Conversions

    You do show some nice style in your coding ... But ... it is NOT good to use NON standard code ... as a general practice ... you want to …
  • Member Avatar for David W
    David W

    Replied To a Post in Corrections Turbo C++ Conversion

    Did you test / see the effect of all the added ? flushStdin(); After all the input ... to ensure that stdin is always flushed BEFORE you try to get …

The End.