Beginners - October 2017 (Page 13)

by chuvak
Overloading >>
 
Im trying to overload the >> operator, so that if someone enters "2018/8/18" as the input, my overloaded operator will disassemble the input and change values i...
[7 replies] Last: if (date.inRangeYear(y) && date.inRangeMonth(m) && date.inRangeDay... (by ne555)
Weight Conversion Program
 
My assignment is to write a program that will convert from pounds and ounces to kilograms and grams. My teacher wants us to make two global constants for the co...
[4 replies] Last: Hello Cplusplusnubblub, Sorry I lost track of this post for awhile. ... (by Handy Andy)
operator overloadin
 
A quick question, I've moved onto operator overlaoding, and I have noticed that sometimes the overlaod is with and & and sometimes not? Question is what are the...
[4 replies] Last: Hi thanks for your answers - Integer is a basic class that I have writ... (by jamesfarrow)
Differences between Structs and Classes
 
Hey there! As the title states, what's the difference, and if there is any, is it of any use?
[2 replies] Last: Thanks alot. (by goldenchicken)
by SasuKe
Print Tree
 
This is my tree(without the underscores): _________5 ________/ \ _______4___8 ______/____/ \ ____11___13__4 ____/ \________\ ___7___2________1 I'm req...
[2 replies] Last: then zero must always be the return value from bt->getData() lets s... (by Jaybob66)
i merged files But...
 
the mreged file gives the output in one line but i use w1<<line<<"\n". #include<iostream> #include<fstream> #include<string.h> using namespace std...
[12 replies] Last: i understand what you are saying. This method would mess up my searc... (by closed account 1vf9z8AR)
Can a function return more than one value?
 
Hi, Just a quick simple question: Can you make a function return more than one value? Thanks in advance!
[5 replies] Last: yes, but you need to isolate the struct definition so you can use it e... (by Jaybob66)
by Mallet
Assignment #2, Payroll Summary
 
Hey guys, I am trying to have a program pull information from a data file and utilize it for the 'cin' inputs (linux redirection/batch mode). At first, ...
[1 reply] : Sounds like the problem you have is that a line could be in one of two... (by Repeater)
by Horki
Cmake with Lua lib
 
I'm trying to add Lua library in Cmake, and don't know how to do it properly. Sample is taken from here (https://www.lua.org/pil/24.1.html). #include <...
[no replies]
help with a gross pay question
 
Im really confused with how to do the gross pay with the void function and how to calculate more then one time for more employees and calculate the total gross ...
[2 replies] Last: Hello BTheMan, An easy way is to do what "Handy Andy" said about refer... (by Xenophobe)
(stringstream)mystr vs. stringstream(mystr)
 
Hi, I'm new to coding and just finished the Compound data types -> Data structures tutorial. In the pointers to structures example I stumbled across a line...
[3 replies] Last: std::stringstream is a class that inherits std::iostream and uses an i... (by helios)
Trying To Match 2 Arrays With Different Elements & Assigned String Literals
 
I have a binary search and am comparing an array called keyword with 84 elements and a second array called unsorted_dictionary containing 16000 elements. The bi...
[7 replies] Last: @ne555 Thank you for pointing that out. I have the feeling my brain w... (by Handy Andy)
by pavank
Problem with codeblocks in MacBook(High Sierra)
 
this is my code:- pavans-MacBook-Pro:~ pavank$ /Users/pavank/Desktop/CPP Codeblocks/kusy/bin/Debug/kusy -bash: /Users/pavank/Desktop/CPP: Last login: Fri Oct...
[2 replies] Last: To expand on Helios' answer, the problem here seemed to be that you ha... (by Repeater)
Calculation of polygon border width
 
Hi people, does anyone know how to calculate the inner border coordinates of a polygon in cpp, if you want a fixed border width? It should look like this: ...
[4 replies] Last: Here is an extended version which calls a separate border() function a... (by lastchance)
istream public function eof() works not as expected!
 
Write your question here. why did the the string "lichao!" be showed twice? 1 #include<fstream> 2 #include<iostream> 3 #include<string.h> 4 #...
[5 replies] Last: > the public function eof() of istream may have a problem in analyzing... (by JLBorges)
Read a file with numbers and letters and total as well as AVG
 
Hello all, I have little experience with C++ code, i have this program that i am not sure how to build. • read the data from the file (via Linux red...
[6 replies] Last: Well, I tested, exactly as posted, the latest code posted above, and g... (by Chervil)
palindrome using stack
 
Write your question here. in this code, before the push error made it. code can operate but there is problem in while code that push to stack int main()...
[4 replies] Last: really appreciate it ! after i asked this problem, i edited code in ot... (by khpark8511)
Getter and Setter functions outside the class
 
edit: I was able to find the answer I was looking for, no need to reply. I'm currently working on an assignment, and for the second part of it I am required ...
[no replies]
how simulated this roulette
 
which is ? the best language for simulate this roulette and thus get more accurate data of the numbers that will come out in each draw .... this roulette this ...
[1 reply] : now says that we must obtain the seeds of the previous draws, of a sp... (by mbozzi)
by Rodev
How/Where can I optimize me code?
 
Hello, I am trying to code a class named longestConsec for an exercise at coding website. So far my code (see below) passes the initial tests, but when I ...
[3 replies] Last: Hope this alternative version could be of any inspiration. Remove all ... (by Enoizat)
October 2017 Pages: 1... 1112131415... 33
  Archived months: [sep2017] [nov2017]

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