• Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Doubly Linked List

    I am creating a doubly linked list and printing a backwards function. Everything is working great in my code, but when the function is printed in reverse, I need it …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Doubly Linked List

    The reason it isn't printing the rest of the list is because... you don't have it printing the rest of the list. Try the following: void printBackwards(ListNodePtr currentPtr) { // …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching please need help with the answer

    3 Write a C++ expression for the following: a. Decrease A by the square root of the values assigned to B. b. Decrease the value of T by two third …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in please need help with the answer

    */me dusts off the boilerplate response for this sort of thing... again:* First off, we don't do other people's homework for them. Second, we *don't* do other people's homework for …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in sum syntax for array list

    Now, are you looking for the middle of the `ArrayList` (that is, the midpoint of the data structure), or the middle of the data set (that is, the median value …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching sum syntax for array list

    How can I sum only the first and the last item in an array list? ex.: list = (300, 450, 150, 800, ...)
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in sum syntax for array list

    **Sandro_1**: If you don't mind me asking, what is it you are trying to accomplish? I'd guess you were calculating the median of the data set, but you didn't specify …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Randomise Function

    In some cases, it is, or at least that is what I understand; from what I have heard, the university systems of India and Pakistan, in particular, mandate that Turbo …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Randomise Function

    Guys can anyone please explain to me the working of this function { "randamise()" }.
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Randomise Function

    Considering that most of the instructors in question also teach C++ as if it were C - using the `stdio` functions instead of `iostream`, not covering classes at all, etc. …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Overloaded ostream operator << issue

    Grr, I meant to give a more detailed explanation of why the namespace for `ostream&` has to be explicitly scoped, but for the life of me I can't recall the …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Overloaded ostream operator << issue

    Hi, I have made a class and have an overloaded ostream operator method in it... However it tells me: "overloaded 'operator<<' must be a binary operator (has 3 parameters)." Can …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Overloaded ostream operator << issue

    As Moschops said, te stream insertion and extraction operators are usually implemented as free functions that is are `friend`s of the class, rather than as members, but it would be …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in loops

    Can you explain, in detail, the problem you are having, or the part you aren't able to implement? I you are getting any error messages from the compiler, please post …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching need some help cant find the error !!!!

    #include<iostream> using namespace std; class product { private: int code; char name[20]; double price; int instock; double soldperyear[12]; public: product(int,char[],double,int); void setproduct(int c , char n[],double p,int i) { setcode(c); …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in need some help cant find the error !!!!

    Let's start by getting this code into some semblance of consistent indentation: #include<iostream> using namespace std; class product { private: int code; char name[20]; double price; int instock; double soldperyear[12]; …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in need Help in the main HELP HELP HELPPP thank uuuu :)

    Trust me, while your compiler may accept `void main()`, and your instructor may have claimed it is acceptable, the standard does not. I would direct you to this [C and …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching High Fashion Department Store

    Hello , I've been trying to figure out this code and determine what's causing the miscalculation on it. Everything seems right for calculation , I don't get why there is …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in High Fashion Department Store

    First off, as I have said elsewhere, in C++ `main()` should always have a return type of `int`. Some older compilers allowed `void main()`, but it is actually not permissible …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Dijkstra Algorithm

    This is a homework problem; however I just want some direction. I have to write a module graph.cpp that implements djikstra's algorithm. so far i am at the reading in …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Dijkstra Algorithm

    Given that zrd0808 hasn't been on Dnaiweb in four years, I doubt you'll get an answer :-)
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Descending Array with given values

    Okay I have an array but how do I make it descending? I have it able to print out 1, 2, 3 but would rather have it do 1 2 …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Descending Array with given values

    It's quite simple: replace the trailing space, `' '`, with `endl` (the end of line marker for ostreams). BTW, you can always use `endl` instead of `'\n'` in C++ stream …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Custom Binary Format

    So, I've written a Custom Binary Format outline but I'm not sure how to translate it to code. I was looking for a few tips on where to get started? …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Custom Binary Format

    Wouldn't make sense to have the class implement `Serializable` rather than hard-coding the file output? I haven't used Java serialization before, so I don't know the limitations and weaknesses of …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching need Help in the main HELP HELP HELPPP thank uuuu :)

    #include<iostream> using namespace std; class product { private: int code; char name[20]; double price; int instock; double soldperyear[12]; public: product(int,char[],double,int); void setproduct(int c , char n[],double p,int i) { setcode(c); …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in need Help in the main HELP HELP HELPPP thank uuuu :)

    > lol guys i told u i need help in the main at > Using the two objects, pointer and reference test all the member functions of your class Actually, …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Can you help me fix this code?

    Adding to what I wrote earlier, here's a simple trick to simplify the printout of the individual hands: char* get_hand_name(hand h) { char names[][] = {"Rock", "Paper", "Scissors"}; return names[h]; …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Can you help me fix this code?

    This is supposed to be a Rock-Paper-Scissors game. Everything's just going fine until I inserted graphics. What I was supposed to do is to display the figures I've poorly made …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Can you help me fix this code?

    Sadly, my earlier recommendation *is* as kind a response as I can make; it really is terrible for any professor to be forcing their students to use something as long …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Hide Private Message in an Image (Python)

    Let's say you want to send a short private message to your friend, but don't want grandma to snoop around and find it. One way is to use the Python …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Hide Private Message in an Image (Python)

    Actually, there already exists a [steganographic plugin for GIMP](http://registry.gimp.org/node/25988), which you can probbly use off the shelf for your purposes. The source should be viewable if you want to go …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Arrays and variables

    **JasonHippy**: This is actually a subtle point, and one that need to be understood: arrays are *not* pointers, **but** when used in certain ways will automatically be 'devolved' to pointers …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Arrays and variables

    I am having a confusing time with understanding arrays and variables because of this reasoning: Variables are aliases for memory locations and array name is the address of the first …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Arrays and variables

    The issue is not between arrays and other variables in general, but arrays and *pointers* to said arrays. An array is not a pointer; it is a regular variable, just …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching C++ Question

    Can someone help me with my assignment?
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in C++ Question

    What program? I see no code posted here. As we've already said, you need to demonstrate that you have made an attempt in earnest to solve to assignment, *and* post …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching The core of the core of the big data solutions -- Map

    Title: The core of the core of the big data solutions -- Map Author: pengwenwei Email: pww71@sina.com Language: c++ Platform: Windows, linux Technology: Perfect hash algorithm Level: Advanced Title: The …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in The core of the core of the big data solutions -- Map

    All well and good, and of some definite interest in general, but... why post this here, except as a way of advertising your blog and thesis? This forum is mostly …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Can anyone explain this code to me ?

    Well, the first thing to look at is the headers, both the names and the format of them. A C program will have headers in the form of `foo.h`, whereas …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in 'string' does not name a type

    Two pieces of advice: 1. Check the switches being passed to g++ by your Makefile or IDE, and make sure that it includes `Wall` (all warnings) as one of the …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching 'string' does not name a type

    OK, I've seen this error explained at least 100 times on the net. But in every case, it seems to be an error of #including <string.h> instead of <string> or …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in 'string' does not name a type

    While you aren't showing it, I assume you are closing the `#ifndef` at the end of the file. As for why it isn't finding the `std::string` class, I'm not sure. …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching loops

    Write a program that calculates how much a person would earn over a period of time if his or her salary is one ringgit the first day and two ringgit …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in loops

    **miazara**: I see that you tried to reply to DaveAmour and rubberman, but you entered the code into the comments, which is too short for such purposes. You need to …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Can anyone explain this code to me ?

    I came across this code of [firefly algorithm](http://en.wikipedia.org/wiki/Firefly_algorithm) and need to use it in my major. If any of you could explain the working of the functions, it would be …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Can anyone explain this code to me ?

    Well, to begin with, this is a C++ program, not a C program, and a poorly written one at that. The header formats indicate that it probably dates back to …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching Graphics.h of Rock,Paper,Scissors

    I need help to display on the screen rock when user picks rock, paper when user picks paper, and scissors when user picks scissors. Thanks
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Replied To a Post in Graphics.h of Rock,Paper,Scissors

    I am going to give you the same advice I give all the students who come here whose professors' are requring them to use Turbo C++ for current-day coursework: * …
  • Member Avatar for Schol-R-LEA
    Schol-R-LEA

    Began Watching c++ program help

    consider a vector R whose coordinates xyz are given by R1,R2 AND R3.the length of the vector R is calculated as R len=squareroot of R1Squared+R2squared+R3squared.write a c++ program to prompt …

The End.