• Member Avatar for David W
    David W

    Replied To a Post in class and objects

    You might start out with a loop ... something like this: // bricks.cpp // // 2015/07/22 // // this version approximates count of bricks needed for a wall ... // …
  • Member Avatar for David W
    David W

    Replied To a Post in class and objects

    It is *not* really the vol of the totalLength x totalHeight x totalWidth of a wall the determines the (min) *integer* number of bricks needed to brick up a real …
  • Member Avatar for David W
    David W

    Began Watching class and objects

    The house is built of non-standard form. All four walls are of a rectangular shape, but different height and length. The width of the walls is two bricks. There are …
  • Member Avatar for David W
    David W

    Replied To a Post in class and objects

    You need to firstly solve the math before you can code ... It is often helpful to solve a much simpler problem at first. If you start out with a …
  • Member Avatar for David W
    David W

    Began Watching Reading data into an array from a file

    I want to read data into an array from a data file. Because I do not know, ahead of time, how much data is contained within the file I need …
  • Member Avatar for David W
    David W

    Replied To a Post in Reading data into an array from a file

    > Can there be a vector of structures? Yes > I am guessing that with data.push_back(temp) the .push_back(temp) is a feature of the vector type. But, it does not seem …
  • Member Avatar for David W
    David W

    Began Watching structures

    i need some help to input some prompting in a ready programm written by someone else for a school,thoughht all night,giving me no errors but the out put is not …
  • Member Avatar for David W
    David W

    Replied To a Post in structures

    Can you show us the code you have tried so far? We really have no idea what your problem is ... until you show us that code. Try this next …
  • Member Avatar for David W
    David W

    Began Watching Progress of a Bubble Sort (C)

    The bubble sort is slow and I thought it would be interesting to visualize the progress as it sorts an array of integers.
  • Member Avatar for David W
    David W

    Replied To a Post in Progress of a Bubble Sort (C)

    Since this thread has been a little resuscitated ... it may be the case that some beginning students in C ... might like to know ... that a simple bubble …
  • Member Avatar for David W
    David W

    Began Watching Strange issue, in function char* prints correctly, while in main it's missi

    Hello everyone! this is a code to reverse strings of a array of char ptr. I am passing the char* array, dynamically allocating memory to reverse and link with the …
  • Member Avatar for David W
    David W

    Replied To a Post in Strange issue, in function char* prints correctly, while in main it's missi

    If you just wish to reverse the order of the lines in the array ... try this: /* demo_str_rev.c */ #include <stdio.h> void str_rev( char* ary[], int size ) { …
  • Member Avatar for David W
    David W

    Replied To a Post in Sub string replace in arr of char *

    Or ... if you'd like to use dynamic memory to hold each C string and ... a dynamic array to hold all the dynamic C strings ... here is an …
  • Member Avatar for David W
    David W

    Began Watching how to program to sort in ascending/descendin order random using LL and DLL

    **Question-1: Write a program to sort in ascending order random entered numbers by user using Linked Lists. - Size of LL is not limited - Entering numbers should be stopped …
  • Member Avatar for David W
    David W

    Replied To a Post in how to program to sort in ascending/descendin order random using LL and DLL

    Do you know how to code a working shell program in C++ ? Do you know anything about using a C++ struct (or class) ... to hold the data for …
  • Member Avatar for David W
    David W

    Began Watching Shallow Copies?

    I'm reading the book 'C++ Without Fear 2nd Edu' and I'm a little confused on the subject of shallow copies. The book says the problems can arise if you make …
  • Member Avatar for David W
    David W

    Replied To a Post in Shallow Copies?

    Take a look here: http://fredosaurus.com/notes-cpp/oop-condestructors/shallowdeepcopy.html
  • Member Avatar for David W
    David W

    Began Watching how to calculate a common exponent from a bunch of float values??

    this applies to 3D vertex coordinates if I was planing to lower the quality and byte size to a bu16, bs16, bu8, or bs8 mantissa, how would I calculate the …
  • Member Avatar for David W
    David W

    Replied To a Post in how to calculate a common exponent from a bunch of float values??

    If I understand your problem, the solution is to define an 'inverse function' for each 'function' : def numSquared( num ): return num*num def inverseNumSquared( num ): return num**0.5
  • Member Avatar for David W
    David W

    Began Watching Sub string replace in arr of char *

    Hello Everyone, I got this question in some book. As per question we need to find a substring in a array of char* and replace it with another string. The …
  • Member Avatar for David W
    David W

    Replied To a Post in Sub string replace in arr of char *

    You could try something like this: /* test_replace.c */ #include <stdio.h> #include <string.h> /* ... need to find a substring in a array of char* and replace it with another …
  • Member Avatar for David W
    David W

    Began Watching Nadia Team

    Problem Statement: NAtural DIAlogue team at Orange labs has an abbreviation "Nadia Team". This abbreviation causes a big problem for them in Egypt as a lot of Egyptians think this …
  • Member Avatar for David W
    David W

    Replied To a Post in Nadia Team

    Since this was your very first post at Dani's 'student friendly' place ... Do you have any idea how to start? 1. Is your data to be read from file …
  • Member Avatar for David W
    David W

    Began Watching Making this more compact

    I have made this code. It is working good. Can anyone please help me to make it more optimised? Here is the code. /* ∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑ Author: Mayukh Sarkar Email: mayukh2012@hotmail.com …
  • Member Avatar for David W
    David W

    Replied To a Post in Making this more compact

    You may like to see this link re. a way to handle new data types in C ... http://developers-heaven.net/forum/index.php/topic,2598.0.html
  • Member Avatar for David W
    David W

    Began Watching split string-multiple delimiter

    Hello, so this user input all in one line string , i need to parse the input into two categories: user age and user name. for example , the user …
  • Member Avatar for David W
    David W

    Replied To a Post in split string-multiple delimiter

    You could try something like this: // split_demo.cpp // /* i need to parse the input into two categories: user age and user name. for example, the user input -->> …
  • Member Avatar for David W
    David W

    Began Watching student record management system with linklist

    **Student and Courses Record Management System (LinkList of LinkList)** In this Assignment you need to create a small student and courses record management system with following functionalities. 1- Add New …
  • Member Avatar for David W
    David W

    Replied To a Post in student record management system with linklist

    Your problem can be more easily handled if it's broken up into two BIG steps... 1st step: Using the C++ library linked list, you can code and test out the …
  • Member Avatar for David W
    David W

    Began Watching compere two string

    i try to compile this programme and thasn't work :p i think that the problem come from the string fonction (int r=strcmp( CL[j].nomC , cl);) #include <stdio.h> #include <conio.h> #include …
  • Member Avatar for David W
    David W

    Replied To a Post in compere two string

    If you can handle more ... and if your spec's are to compile with a C++ compiler, (but to restrict the 'io' to C style), then ... this example ... …
  • Member Avatar for David W
    David W

    Began Watching Output from string datatype is not correct

    #include <iostream> #include <cstdio> #include <conio.h> using namespace std; main() { FILE *fp, *ft; char another, choice; struct student { int id; string name; int age; char gender[7]; string address; …
  • Member Avatar for David W
    David W

    Replied To a Post in Output from string datatype is not correct

    Your data-record structure is NOT what you need here ... Try something like this: // bloodGroups.cpp // #include <iostream> #include <string> #include <cstring> // re. strcpy #include <cstdio> // re. …
  • Member Avatar for David W
    David W

    Began Watching Veriables

    hello all, i am a beginner, in C++ we declare varables for example just like(int (variable);. and after this we put some value to variable. but i want that system …
  • Member Avatar for David W
    David W

    Replied To a Post in Veriables

    If you mean that you want the program to prompt for a variable name, you would also want to prompt for the variable type. You could use a C++ map …
  • Member Avatar for David W
    David W

    Began Watching help needed in programing

    Write a function in C++ which accepts an **2d array and its size** as arguments/parameters and exchanges the values of *first half side elements with the second half side elements …
  • Member Avatar for David W
    David W

    Replied To a Post in help needed in programing

    Can you write a 'prototype' for the function? (That could get you started?)
  • Member Avatar for David W
    David W

    Replied To a Post in C++ Program to Find the Shortest Cycle in a Graph

    P.S. You may find some related examples here: http://developers-heaven.net/forum/index.php/topic,2614.0.html
  • Member Avatar for David W
    David W

    Began Watching need help please

    Write a function to take an integer and two character. Your function should draw a shape similar to the one below. For example: DrawShape( 5, '#', '*') Outputs the following …
  • Member Avatar for David W
    David W

    Replied To a Post in need help please

    This example also ensures the prgram will NOT crash if bad data was entered: // drawShape.cpp // #include <iostream> /* **when compiling it gave me the right shape and there …
  • Member Avatar for David W
    David W

    Began Watching C++ Program to Find the Shortest Cycle in a Graph

    Hi. I need to write a program that finds the shortest route in directed graph. Please look at the picture. [Click Here](https://goo.gl/photos/uRdTfp9pDrAobun87) Here is my code: #include <iostream> using namespace …
  • Member Avatar for David W
    David W

    Replied To a Post in C++ Program to Find the Shortest Cycle in a Graph

    You will find that help comes more readily if you present the problem clearly. Provide the shortest amount of code possible to illustrate the problem. State clearly the problem ... …
  • Member Avatar for David W
    David W

    Began Watching help pleaseeeeeeeeeeeeeee

    **5. Consider a data file named STORES.DAT, which contains inventory information for four shops. Each line in the file contains the inventory of five types of merchandize in each store. …
  • Member Avatar for David W
    David W

    Replied To a Post in help pleaseeeeeeeeeeeeeee

    The data file example you provided above ... looks defective? > ... Consider a data file named STORES.DAT, which contains inventory information for four shops. Each line in the file …
  • Member Avatar for David W
    David W

    Replied To a Post in Was this task even more difficult in the early days of C in 1970?

    @Frederick2 Do you have any Windows graphic library function calls ... anything like this ... move_to(int x, int y); move_to(double x, double y); draw_to(int x, int y); draw_to(double x, double …
  • Member Avatar for David W
    David W

    Replied To a Post in C++ Getline function error with strings

    This little demo may help ... // demo_cin.sync.cpp // #include <iostream> #include <string> #include <cctype> // re. tolower, toupper int takeInChr( const std::string& msg ) { std::cout << msg << …
  • Member Avatar for David W
    David W

    Replied To a Post in C++ Getline function error with strings

    > what (does) cin.sync() do http://www.cplusplus.com/reference/istream/istream/sync/
  • Member Avatar for David W
    David W

    Began Watching link list

    Hey, I need to create a war card game. I have a problem with linked list - I read about it but still I have a problem with writing the …
  • Member Avatar for David W
    David W

    Replied To a Post in link list

    This may give you some more ideas ... and some more tools (C utility functions) to use in your code: (You could use a 'Clist' by including file Clist.h available …
  • Member Avatar for David W
    David W

    Began Watching Was this task even more difficult in the early days of C in 1970?

    I've been working on this project for about two weeks now. Essentially it checks the date, finds events for the day, tells you about them and even lets you plan …

The End.