Beginners - October 2019 (Page 13)

Hackerrank array input method
 
Hello everyone. Can u plz ecplain or post a link where I can understand the method used by Hackerrank to input an integer array in one line all together ??
[1 reply] : What method? I would have guessed that any valid code which actually ... (by salem c)
If/else run-time error
 
Hello, I'm having trouble with my code. It compiles fine, but one of my if conditions isn't being recognized at run time. The issue is that if I type "computer ...
[3 replies] Last: It works now! Thanks for the help. Also had to add cin.ignore() since ... (by commitzero)
by AL88
overloading ostream issue
 
Hi I got this of a youtube video but I can't get it to compile, can anybody tell me what is wrong and teach me a bit about overloading the ostream operator? I ...
[4 replies] Last: Thanks for your invaluable help, got it to compile :-) (by AL88)
Incorrect Output
 
I am doing an assignment for a class in which the user must input a grade for their last test and the program will return with whether they passed or failed tha...
[4 replies] Last: It worked! I am still a beginner at C++ so thank you for the help! (by ajent047)
Minesweeper game problem
 
Hello all.I am trying to write a console Minesweeper game.But my program crashes from one function that if none of its neighbors contains a bomb, then all the a...
[7 replies] Last: Yes thank you very much.I get it now.Because I do not check if that ti... (by Zivojin)
Capitalize first two letters of a given string
 
I am making a code that needs a way to capitalize the first two letters of a given string. Example: if input string is aplle it should be outputted as APple. An...
[3 replies] Last: Each condition in an if statement must be independent, you need a con... (by Yuripetrocchi)
Sorting with random numbers
 
Using the rand () function, fill 5 arrays of integers with the same 10 random numbers. These numbers should be values between 1-100. The arrays should hold 10 i...
[9 replies] Last: ... it defines a timer, put it right above main and use it in main as ... (by jonnin)
basic help -function and structs.
 
I JUST NEED HELP ON THE WRITING THE FUNCTION PART. write a function called calculatePay( ) which takes an employee as an argument and returns the amount of mon...
[8 replies] Last: if (e.hours > MAXREGHOURS) { //... } //if (e.hours <= MAXREGHOURS)... (by ne555)
by Jamec
Can someone explain why my code isnt working?
 
So im trying to write some code for one of my classes and I cant figure out whats wrong with it, its suppose to sort a single row of a matrix of type Char. Its ...
[8 replies] Last: This: array is array notation. (by jlb)
by amgs65
Using do while loop to get the average of ten numbers.
 
I have an assignment to do in C++. I need to use do while loop to get the average of ten numbers. I'm having a very hard time. Can someone help me out? Thanks i...
[3 replies] Last: It's trivial to convert a for loop to a while loop. The for loop stat... (by MikeyBoy)
Adding rationals with overloading operators
 
I'm close to getting the code right, but I'm missing something. Anytime I add a rational with the same denominator it works fine, but I need a little help with ...
[3 replies] Last: Line 25 simply overwrites the value from line 24. I guess you want lin... (by coder777)
Accessing Private Variables Within Class
 
Quick question on private variables. If I want to access a variable from within the class, how does that look? For example, if my header file had: class s...
[3 replies] Last: when you call a member function, the object is passed as a hidden argu... (by ne555)
by Ineff
Code Review
 
I am in the process of learning C++, the code i have made is a basic calculator and a number guessing game. I am trying to get a full grip on classes and object...
[11 replies] Last: By including the header files in <>s before any header files in ""s. ... (by MikeyBoy)
by zak100
File header Size
 
Hi, I want to change the header of some document files like pdf, ms word, libre office programatically. I know that I have to use some byte type command like ...
[6 replies] Last: but I can't find a similar library for PDFs Funny, I found plenty. T... (by Duthomhas)
Need good workaround for simple double errors. (1,2)
 
I understand accumulating errors in math where numbers can have infinite decimal places (ie. sin, cos), but for simple numbers that don't produce infinite decim...
[32 replies] Last: Some other comments: Surveyors GPS have had the L5 signals for a long... (by TheIdeasMan)
by colt
How my program is find these two classes?
 
Hello I have the following class #ifndef __MATRIX4x4_h #define __MATRIX4x4_h //#include "Vec4f.h" //class Vec4f; class Matrix4x4 { public: inline...
[3 replies] Last: //a.h #ifndef a_guard #define a_guard void a() {} #endif //b.h #ifn... (by poteto)
Pointers to structures (1,2)
 
Hello guys, I really need some help with this. I got it fully working with an array of structs, but now having an issue using pointers. We are not allowed to us...
[20 replies] Last: It wasn't in the instruction sheet I posted. It might have been mentio... (by XboxOne2019)
Need Help: Wholesaler Problem
 
My professor doesn't really go over major concepts in class and I'm very confused on how to write this C++ program without if-else statements... The problem ...
[4 replies] Last: #include <iostream> #include <iomanip> using namespace std; void get... (by lastchance)
segmentation fault with string and char*
 
hello I'm trying to use SQLite in C++, but Im having some trouble. I want to use the following SQLite statement, but it gives me a segmentation fault in the s...
[7 replies] Last: > std::string str = sqlite3_mprintf("INSERT INTO table (number) VALUE... (by ne555)
Casting subclasses via an interface
 
I wrote some code in c# that I am porting to c++. I have a base class which contains the default implementation of a method (BaseClass::getTagName()), and some ...
[10 replies] Last: No worries, I didn't interpret anything said as being contradicting. T... (by Ganado)
October 2019 Pages: 1... 1112131415... 18
  Archived months: [sep2019] [nov2019]

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