• Member Avatar for David W
    David W

    Gave Reputation to john.kane.100483 in Explanation

    Thanks sir David W and I'm really thankful to this site because my program was accepted by my prof and she was so impress about it. I explain it every …
  • Member Avatar for David W
    David W

    Began Watching c++

    I am new to this and i need an example programs for copy constructor and nesting classes
  • Member Avatar for David W
    David W

    Replied To a Post in c++

    Have you tried to Google for any examples? But here is one link that my be helpful, if you need one more example? A linked list ... with nested class …
  • Member Avatar for David W
    David W

    Began Watching Explanation

    Hello :D I would like this to be explain. What is meaning of this following codes and why are they in there? I really don't understand. void Binary2Decimal() total=0 "%16s" …
  • Member Avatar for David W
    David W

    Replied To a Post in Explanation

    Hey John, if you really wish to learn to code in C++ and / or C, you have one really great thing going for you, that all programmers need ... …
  • Member Avatar for David W
    David W

    Began Watching Adding elements to linked list in correct order (ADT Priority Que) problem.

    I am implementing Priority QUE as a doubly linked list. My structs: typedef int kintyr; typedef struct qElem { struct qElem *prv; kintyr *dat; int *priority; }qElem; typedef struct que …
  • Member Avatar for David W
    David W

    Replied To a Post in Adding elements to linked list in correct order (ADT Priority Que) problem.

    Can't really check ... since some stuff missing ... too many problems to compile ... Turn all your compiler errors / warnings on ... See the changes / comments here …
  • Member Avatar for David W
    David W

    Began Watching Need help with scanf function

    I need help in reading numbers using scanf functions. A range of numbers have to be scanned.No array should be used.No limiting condition for reading is given.What shall i do.?
  • Member Avatar for David W
    David W

    Replied To a Post in Need help with scanf function

    Some times the very beginning steps of computer programming seem 'very hard' ... but like learning any new complex thing ... once you 'see' how it works ... and 'how …
  • Member Avatar for David W
    David W

    Began Watching pointer help!!

    The question: Modify the first Loop so that the values in the array data are initialized to multiples of 2 as follows: 2,4,6,....,20. here is the original codes that has …
  • Member Avatar for David W
    David W

    Replied To a Post in pointer help!!

    When you begin computer programming ... don't leave your 'normal thinking skills' ... behind. How is the series 2,4,6,8, ... related to 1,2,3,4, .. . Answer: ? How could you …
  • Member Avatar for David W
    David W

    Began Watching Passing String

    Is this correct? #include <stdio.h> #incluede <string.h> void getname(char name[][50],int num) int main() { void getname(char name[][50]) { for(int i=0;i<numofname;++) scanf("%[^\n]",name[i]); }
  • Member Avatar for David W
    David W

    Replied To a Post in Passing String

    Also ... interesting spelling :) #include <stdio.h> /* #incluede <string.h> */ /* that's how I feel sometimes :) */ #include <string.h> void getnames( char name[][50], int num ) ; void …
  • Member Avatar for David W
    David W

    Began Watching Large data type in c++

    Is there a data type that can allow a user to input a 25 digit number... because the largest data type for numbers that i know is long long int …
  • Member Avatar for David W
    David W

    Replied To a Post in Large data type in c++

    If you would like some ideas about coding / using big Integers, this link may give you a start ... [Big Numbers](http://developers-heaven.net/forum/index.php/topic,426.0.html) Also, you may like to know that Python …
  • Member Avatar for David W
    David W

    Began Watching files

    Need Help.. how to write a program that puts the integer from 1 to N into each circle separately, in such a way that the sum of the numbers in …
  • Member Avatar for David W
    David W

    Replied To a Post in files

    Looks like a fun project ... can you code a working shell to get started? Announce what the program is about Ask for (validated) input Call a function, passing in …
  • Member Avatar for David W
    David W

    Began Watching C++ programming

    I am having problem with programming, i have been given a program to perfom and so far i have benn unable to start..can anyone help me? This is my question..1. …
  • Member Avatar for David W
    David W

    Replied To a Post in C++ programming

    Do you already have a string class to work with? If NOT, you seem to be off on the wrong track ... ? A common student problem is to build …
  • Member Avatar for David W
    David W

    Replied To a Post in Vectors/Classes Program, Need Help

    Now re. your distance between two cities problem, you like to see the list and vector examples here ... CitiesListType_sort3.cpp CitiesVectorType_sort3.cpp [list or vector type]( http://www.4shared.com/folder/30qr0Y7D/distanceTwoCitesList.html)
  • Member Avatar for David W
    David W

    Replied To a Post in Vectors/Classes Program, Need Help

    Please see my recent post in the C forum, that shows an easy way to submit code and preserve the indentation. [KEEP indentation](http://www.daniweb.com/software-development/c/threads/474771/base-conversion) A copy below: > It seems you …
  • Member Avatar for David W
    David W

    Began Watching Base Conversion

    Ok the admin said to me not to post in C++ if my problem is in C language. Ok here's my problem with my program now. #1 If I put …
  • Member Avatar for David W
    David W

    Replied To a Post in Base Conversion

    It seems you still have NOT mastered a 'basic' here at Dani... i.e. submitting code in such a way as to preserve the indentation formatting ... Please learn how ... …
  • Member Avatar for David W
    David W

    Began Watching Sorting in text file through program in Qt

    I am using Qt5.2.1 I made a program that stores some values(like name, number, other details...) in a text file. I want to arrange this information according to the name. …
  • Member Avatar for David W
    David W

    Replied To a Post in Sorting in text file through program in Qt

    And when you hit the next letter ... i.e. when you reach B after printing all the A's ... print a blank line You may need to first switch to …
  • Member Avatar for David W
    David W

    Began Watching A DOUBTFUL QUESTION..

    can some one help me with this question.. "The name of students are sorted in an array of strings.Write a program to prepare alphabetically sorted listing of names.."
  • Member Avatar for David W
    David W

    Replied To a Post in A DOUBTFUL QUESTION..

    You may like to see this ref link to the sorts that already come in the C++ library [library sort](http://www.cplusplus.com/reference/algorithm/sort/) The example at the above link is for sorting a …
  • Member Avatar for David W
    David W

    Replied To a Post in Vectors/Classes Program, Need Help

    Yes ... you could use a vector (instead of a list) ... But using iterators makes your code much easier to re-code (to use a vector or to use other …
  • Member Avatar for David W
    David W

    Began Watching Hello everyone,i need yor helpp in answering a few questions.

    A hardware merchant sells steel bars at a flat rate of Kes 1000.00 per meter, and has announced the following discounts: Quantity of steel bar bought (per meter) Discount (%) …
  • Member Avatar for David W
    David W

    Replied To a Post in Hello everyone,i need yor helpp in answering a few questions.

    Just a variation on the theme... (for your enlightment and enjoyment) ... Note the simple looping exit condition ... The loop is exited when a cin error flag is raised …
  • Member Avatar for David W
    David W

    Began Watching Octal2Decimal & Hexa2Decimal Correction

    Hi everyone my Binary2Decimal is okay now because it can now hold 16 digits. But how come my Octal2Decimal and Hexa2Decimal can't hold 16 digits to convert to decimal it …
  • Member Avatar for David W
    David W

    Replied To a Post in Octal2Decimal & Hexa2Decimal Correction

    If you look at this table: BASE Dig Max Decimal String rep (note string len = Dig col value) ======= == ========== ================================ base 2, 32, 4294967295, 11111111111111111111111111111111 base 3, …
  • Member Avatar for David W
    David W

    Replied To a Post in Multiple data in a queue

    How does the above question, relate to your original thead here: >I want to create a queue that holds certain information. >I want it to hold multiple peices of information …
  • Member Avatar for David W
    David W

    Began Watching file handling

    plz tell me
  • Member Avatar for David W
    David W

    Replied To a Post in file handling

    Have you done a web search on "C++ file handling" ? Then try out some code to create a simple text file of data lines Then read those lines back …
  • Member Avatar for David W
    David W

    Began Watching Help with C++ program

    How do I change this code so that the user can choose a math operation and determine have that type of operation(either add sub mult or divide) run as much …
  • Member Avatar for David W
    David W

    Replied To a Post in Help with C++ program

    > ... code so that the user can choose a math operation and ... have that type of operation(either add sub mult or divide) run as much as a user …
  • Member Avatar for David W
    David W

    Replied To a Post in passing double arrays to functions

    Oops ... I think you meant to use ... int main() { /* your code ... */ return 0; }
  • Member Avatar for David W
    David W

    Replied To a Post in Vectors/Classes Program, Need Help

    Firstly ... you need to recode each class into two files: The .h file with appropriate 'guards' (prototypes) and ... The .cpp file ... (include .h files needed, and any …
  • Member Avatar for David W
    David W

    Replied To a Post in Checkbook program

    But ... the first part (of the 2nd step) ... is to get the first program (stage) ... working ... the way you wish. See this example, for a common …
  • Member Avatar for David W
    David W

    Replied To a Post in Multiple data in a queue

    Nice :) In C++, why not rather use C++ (safe) strings? // in C++ ... why not use (safe) C++ string ? #include <iostream> #include <string> #include <queue> struct Person …
  • Member Avatar for David W
    David W

    Replied To a Post in Base Conversions

    @tinstaafl ... a Dani Virtuoso indeed ... very well designed and developed ... and demos the efficent code that can be often obtained by the use of tables. This variant, …
  • Member Avatar for David W
    David W

    Replied To a Post in Is there a way to print a queue?

    See this (reworked) example ... (now with a struct) that has a friend ... an overloaded operator << // dequeExample.cpp // #include <iostream> #include <deque> #include <queue> struct Contact { …
  • Member Avatar for David W
    David W

    Replied To a Post in Is there a way to print a queue?

    Not really needed ... Just use the C++ overloaded operator << to define how you wish to print a struct (or class)... when using iterators Can use a friend function, …
  • Member Avatar for David W
    David W

    Replied To a Post in Is there a way to print a queue?

    Your code makes NO sense ... THINK what you are doing! Try what I (edited and) posted above ... for deque. // dequeExample.cpp // #include <iostream> #include <deque> int main() …
  • Member Avatar for David W
    David W

    Replied To a Post in Is there a way to print a queue?

    Do you know what an iterator is? (Or a constant iterator? ... to traverse each address in a deque ... so ... you can access the values at each address …
  • Member Avatar for David W
    David W

    Replied To a Post in Is there a way to print a queue?

    You know .. the joy of having access to your own PC and compiler ... is that you can fairly quickly 'try things out for yourself ... and see.' Enjoy …
  • Member Avatar for David W
    David W

    Began Watching Is there a way to print a queue?

    I am trying to print my queue which has values in it. Right now i have this. for(int i = 1; i<ReadyQueue.size(); i++) { } But i am stuck now …
  • Member Avatar for David W
    David W

    Replied To a Post in Is there a way to print a queue?

    Did you read the link I gave you on your other post? (Please do not have multiple theads ... on the same subject.) [Click Here](http://www.cplusplus.com/reference/queue/queue/)
  • Member Avatar for David W
    David W

    Replied To a Post in How to queue into a class

    You seem to have this 'backwards' :) You load (assign) data into (each member in) a data struct Then you add (push) each loaded (data) struct to the queue. Code …

The End.