Beginners - November 2017

about operator overloading
 
when i run this i get the following error: cannot overload functions distinguished by return type alone. Book& operator + (const Book& b1, const Book& ...
[1 reply] : Not exactly sure what the compiler is trying to say there, but your fi... (by Ganado)
by Rale
output digits of an n number
 
Hello guys, I have an problem with outputting all digits of an number. I know with 2, 3, 4, 5, 6 and so but i need to write all this code for lets say 3 digits...
[4 replies] Last: #include <iostream> void digits( unsigned long long n ) { if (n) std:... (by lastchance)
Problems with private variables
 
Hey guys, I've been having a problem understanding why I can't write this code the way it is. So I have these class functions with the variables x and y bein...
[6 replies] Last: This works so I guess all's well? ~Talemache bool compare(const Lo... (by talemache)
Unseen function
 
I have a function findSum in my code, but my compilator neither sees it, nor outputs it. #include <iostream> #include <cstdlib> #include "math.h" using n...
[3 replies] Last: Hello Yana111, What keskiverto said. Other than some warnings about c... (by Handy Andy)
by dubley
sizeof and placement new
 
Hello, in the following code I am confused about what is going on in line 41: pd2 = new (buffer + N * sizeof(double)) double ; I cannot understand what sizeof i...
[4 replies] Last: Thank you very much for your help. (by dubley)
read string
 
HI. I have text file like this: TATAGTTGATTGTCTGCGTCATGTTCTTCTTCTGTCTTATGACGGAAAAGTGAGTTGGAGTCGTGTGGCGTTCAGGT and I need to count how many times they are co...
[3 replies] Last: struct myCounter { unsigned int A; unsigned int G; unsigned int... (by AbstractionAnon)
2D array word search solver needs to work in 8 directions
 
I need to make a word search program that takes in a txt file like this 15 N O L X Y H H J T R H H N F D R X Q M F R W F M R G A D P J X H B F V P A I A...
[2 replies] Last: I am actually really lost... first can someone explain to me how the c... (by shbm111)
AVI file too big to stuff into c array?
 
It seems like manipulating files is convoluted in any language. It's like... there's a sequence of bytes over there in a file, I want them as manipulable data i...
[7 replies] Last: I tried JLBorges c example (taught me that fwrite automatically moves ... (by ineedastupidusername)
by XAHTC
Console Snake. Snake can crawl in opposite direction
 
I have tried to make simple Snake from example and find one bug: snake can crawl in oppostie direction. I have tried to fix it by true-fals variables, but somet...
[no replies]
Problems with functions
 
I need to find x, y, sum and modulus of difference between y and sum using functions. But the program does not calculate the functions. Here is my code: #incl...
[3 replies] Last: int result = findX(somevariable, 12, 5, anothervariable, ... etc.. );... (by jonnin)
Cursor position, cout problem
 
Hello, I have a problem with displaying text using cout << in a user-specified cursor position class kord {   int posX, posY; std :: string text; p...
[2 replies] Last: If you use Windows http://www.cplusplus.com/forum/beginner/4234/#CH_i1... (by Thomas1965)
Program Help Please!
 
Program Not Functioning Properly! Please Help! My "Other isn't giving out the right output! Some of my other character are reading as special characters! I also...
[3 replies] Last: Hello marqual123, After testing the program I found lie 50 to be a pr... (by Handy Andy)
I cannot understand why my homework ask :(
 
This is my second homework but is too hard to me, a lot of things i cannot understand. At Least help me finish two part, thanks a lots :D #include <iostream> ...
[4 replies] Last: ok, got it (by johson123)
inheritance
 
Hi guys I'm just wondering about inheritance and why this is and isn't legal first I don't understand how you can set a base class to be equalled to a derive...
[7 replies] Last: You're welcome - glad it helped! (by MikeyBoy)
Hangman game
 
I need help writing the .h file for this code. I'm new to c++ and have some scratch code written but it's honestly not even worth posting here. Main program pro...
[1 reply] : Line 40: Your program has a hangman class, so you need to define that... (by AbstractionAnon)
closest to the average
 
I wrote a program to get 10 numbers then find their average and then to cout the number that is closest to the average. for some reason when I entered ( 1.1 8.7...
[1 reply] : what did I do wrong IMO, the first thing you did wrong was to use me... (by jlb)
right angle triangle
 
I wrote this code to get a number from user and if it is possible to make a right angle triangle with it I want it to give out the numbers from smallest to bigg...
[2 replies] Last: Breaking out from nested loops can be neater with a function: #includ... (by keskiverto)
Can someone give me an opinion on this code?
 
Hello! Yesterday when I was in a lecture of num. methods.My Professor said that programing is basically an automation of everyday tasks and time consuming exce...
[4 replies] Last: All three answers are wrong (well, I suppose answer #2 is not wrong ,... (by helios)
Sorry to bug you all but I need some advise
 
I'm not sure if it's me but evertime I step away from c++ I keep forgetting, or worse going backwards but I'm still trying to stick at it, (even tho people say ...
[4 replies] Last: You mean i'm doing this? Yes. We both do create three unrelated obj... (by keskiverto)
by kannu
please help me to fix this project showing lnk 2005 error on visual studio 2017
 
#pragma once #include <iostream> #include<string> using namespace std; const int MAXPARKINGSPACE = 100; class carparked { private: string carMake...
[2 replies] Last: Hello kannu, After figuring out that your code is in three sections I... (by Handy Andy)
November 2017 Pages: 123... 33
  Archived months: [oct2017] [dec2017]

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