Beginners - August 2017 (Page 12)

by nomat
Some guidance needed
 
Can someone please help me come up with a pseudo code for this question. I can't seem to figure out an algorithm that makes sense. A program that reads text ...
[5 replies] Last: a really snarky way to do this (for ascii, unicode isnt possible) is t... (by jonnin)
Liskov Substitution Principle (LSP) examples
 
I'm studying LSP fundamental design rule. In the slides I'm reading there are the following statements: a) A SortedList is not a List c) A ColoredPoint is not...
[1 reply] : > So why a SortedList is not a List? A SortedList is a List. Howeve... (by JLBorges)
Function that does absolutely nothing ?
 
Is there a function that does absolutely nothing in c++ ? I want to make something like : c=_getch(); if (c=='1') { do x; } if (c=='2') { do nothing;...
[7 replies] Last: If int i were outside the loop and used elsewhere in the code block,... (by JLBorges)
by Bopaki
My program runs but displays a message that it has stopped working correctly
 
Write your question here. Can anyone help me with this message : Head_insert.exe has stopped working. A problem caused the program to stop working correctl...
[5 replies] Last: Thank you all. Everything became OKAY!!! after initializing the head t... (by Bopaki)
Weird switch error
 
Hello, noob here. Been trying to make a calculator but i keep getting the same error (Error: expected ':' before cout). This is reported on the switch section. ...
[2 replies] Last: Hello gadamidis1, Actually the error is not that weird. Keep in mind ... (by Handy Andy)
Why is my bool pointer comparison function always returning TRUE?
 
As the title says. I'm trying compare two int arrays using pointers, with the code below. It _does_ return a value but the value is always 0, and I'm not quite ...
[11 replies] Last: Try this: #include <cstdlib> #include <iostream> using namespace std... (by lastchance)
Binary Search Tree Clear Method Malloc Error
 
I'm attempting to clear my entire binary search tree but it gives me a malloc error after deleting the first node. I've looked online at multiple examples and e...
[3 replies] Last: Firgured it out. That's good. I didn't want to distract you from s... (by Chervil)
Need assistance with Exerecise 7.3.3 C++
 
Revise the example so it implements the bubble-sort algorithm, which is potentially faster than the selection-sort algorithm. I just need to know what to chan...
[1 reply] : double post: http://www.cplusplus.com/forum/general/219978/ (by Thomas1965)
by stas76
correct new element pusch_back to the vector
 
Hello I'm reading The C++ PL B. Stroustrup and trying to overload istream >> operator but something doing wrong and I can't catch what I'm doing wrong Te...
[3 replies] Last: Could you explain more please. I tested the code above, it should wor... (by Chervil)
Binary Search Tree Insert Method Error
 
EDIT: I've come across an error. Once i insert the new node into the tree and use a search function to see if it has been inserted it works and then my insert f...
[6 replies] Last: Ohhh That makes so much more sense. I see that now. Thank you for your... (by kingkush)
NOT RUNNING
 
#include<iostream.h> #include<conio.h> class numbers { private: int a,b; public: void readnumbers(); void add(); }; void numbers::readnumb...
[6 replies] Last: WORKING PERFECT!!!! THANKS... (by p01ajanikar)
Reading string from the file and convert it to vector<double>
 
Hi, I tried to read string from the file and convert it to a vector. But I don't know how to deal with decimal numbers. I also know how to use stod to convert ...
[2 replies] Last: Thank you so so so much. It works!! (by semimartingale)
Functions combining
 
I am trying to make sure I understand functions, so I am writing a small program to re-enforce my learning. The first one is: float getBudget(float car...
[14 replies] Last: Yes, and I have a lot better understanding of functions and vector. Th... (by SlowBug2319)
template class implementation errors
 
Below are my codes to generate random numbers based on user-defined weighting values. It all works, until I tried to make the type of data become any types, e.g...
[2 replies] Last: Thank you. I think I know how to fix it now. (by landlord2017)
by nomat
Calculating the median from a set of numbers
 
I am supposed to compute the median from a data file with sorted numbers and display the contents of the data file on the screen as well as the median. I think ...
[3 replies] Last: Hello nomat, lastchance has given you a good explanation of how to fi... (by Handy Andy)
by qweali
call an object from inside of another same kind object
 
hi im kinda new in learning c++. i have a problem with objects. i have a vector of a certain class which means a vector of objects. how can i call an object...
[7 replies] Last: It is possible you will find a much better solution if you decide to... (by gunnerfunner)
Code Review
 
Can someone review my code and let me know if there are any big mistakes. The program compiled correctly, but I just wanted to know if I correctly handled point...
[1 reply] : #include <iostream> #include <memory> #include <typeinfo> struct Fly... (by JLBorges)
my outputs are not place where i want them to be
 
I am creating a monthly net income budget calculator, but when I enter some outputs, my program doesn't run the way I was expected. For some reason, my monthl...
[3 replies] Last: yes i did a lot a careless mistakes thank you! (by lescarys)
by nomat
24 hour date format confusing
 
Guys this program is supposed to do this but I got as far as calculating the difference in hours then got mixed up on how to format to 24 hour time: Write a...
[1 reply] : Remember that there are only 24 hours in a day, numbered 0..23. Any t... (by Duthomhas)
by i773
Possible to cast void* (Handle) to string?
 
I have a external generic function that sets a void* 'returnData': SPErr PIUGetInfo(ClassID desiredClass, KeyID desiredKey, void * returnData, void * retu...
[6 replies] Last: What is that SPErr in SPErr PIUGetInfo(...? What value does that func... (by i773)
August 2017 Pages: 1... 1011121314... 17
  Archived months: [jul2017] [sep2017]

This is an archived page. To post a new message, go to the current page.