Beginners - February 2020 (Page 11)

by Bopaki
The is a digit figure 1 printed in every line
 
The output is not exactly as it should be. Here is the correct output: Count to what value? 4 Starting count, level 1: val == 4 Starting count, level ...
[4 replies] Last: Thanks to all. I finally got it right and got the correct output. (by Bopaki)
inf result to calculate standard deviation
 
"Write a program that takes its input from a file of numbers of type double. The program outputs to the screen the average and the standard deviation of the num...
[1 reply] : double n1, n2, n3, n4, sum = (n1 + n2 + n3 + n4), Variables don't ... (by Ganado)
how to access hash table from all other classes
 
I cant post code since it is a lot, but basically i have a hash table class, created in hash.cpp and hash.h and then a create the table in the main.cpp using h...
[4 replies] Last: Thank you, ive passed in the hash table to the function itself and ha... (by MyOnlinePersona)
counting
 
Solved
[10 replies] Last: You’re absolutely right Duthomas wet markets don’t have friends.... (by againtry)
Creating a list using <fstream> and nested if/else
 
So I am doing a homework assignment but I do not understand if I am doing it right or absolutely wrong on how I am using the <fstream> with a while loop and nes...
[6 replies] Last: I would like to thank everyone for the useful advice on the usage of f... (by DrCoke21)
Reading float type from a file and using them in formulas (1,2)
 
I am trying to read numbers in two columns that are separated by a space from a .txt file and use them in formulas within my code and output the results into an...
[35 replies] Last: You guys rock!! Perfect score!! (by Vaughnpkk)
Problem With Tic Tac Toe Function
 
Hi, there's an issue with my void input function When it's called, i ask the user for a choice for where they want to go on the board, i want to then input t...
[5 replies] Last: Hello Zainyorkshireman, I came up with this as a start. You may fine ... (by Handy Andy)
Problem with while loop
 
Hello, I'm at the very beginning of learning C++. I'm having a difficult time to understand why my while Loop doesn't work. I wrote the following Code to bett...
[6 replies] Last: @Repeater I just noticed it too. I'm struggling with the {}. Trying t... (by TheCodingSnake)
difference
 
I am in the process of trying to create a function that can find the difference of two sets. It seems to work on some test runs but not others. For example:...
[11 replies] Last: To avoid any problems with memory leak or dangling reference just don'... (by ne555)
by dorlow
Need advice on how to learn c++
 
So, a few months ago, I signed up for an online university to learn how to program. I'm in the first programming course and I'm not happy at all the way they'r...
[2 replies] Last: edx is really nice as well. (by rjphares)
Pointer-offset notation??
 
I got the question that I have to do but I missed the first day of class and have idea what is going on. a. Define a function strLength() to calculate the nu...
[6 replies] Last: You're close. Just do const char* b = "hello"; instead. Notice the dou... (by Ganado)
I can't figure out how to start this.
 
Hi I have a problem I was assigned and I can't, for the life of me, figure out how to even start this. The problem is : The screen size of a TV is given b...
[1 reply] : Pythagoras: diagonal squared = length squared + width squared #includ... (by againtry)
by Lodyce
I cant get one of my lines to dispay
 
I'm a new programmer in my first class. I am supposed to write a code that calculates gross/net pay from hours and hourly rate. When you run the program it star...
[2 replies] Last: thank you I just quit out of microsoft visual studio and opened up new... (by Lodyce)
Which method is more efficient to merge strings?
 
Hello gurus, here is a question from an exercise: Requirement: merge content of two strings. First method must use "new char". The second method should concaten...
[3 replies] Last: the top one is exceedingly bad, not just for the dynamic memory, but t... (by jonnin)
Srand and rand
 
I am working on an assignment where you have to generate 2 random numbers and then find the sum of those 2 numbers. Every time I enter a seed to initiate, the o...
[4 replies] Last: dutch, I now see the issue! Thank you for posting a go-by code as well... (by BigWalrus1)
Rabbin Karrp iplementation using hash problem
 
I have written hash.h file, that I want to use for implementation of RK algorithm. So far I have wrote this. #ifndef HASH_H #define HASH_H #include <vector>...
[9 replies] Last: yes, I see that one. but where do you define int Hash(string)? (by jonnin)
overloading operators issue with addition
 
Having issues with adding objects. It seems to work when adding two, ex: 2.34 + 34.57 = 36.81, but fails when adding 3 or more ex: 6.78 + 9.81 + 4.59 = 79.59 <-...
[2 replies] Last: previous post had a diff issue that was solved. But I figured out this... (by Volapiik)
Can I use vector as pointer?
 
I'd like to do something similar int create(int number, vector<string>* status) { vector<string> status_list; if(number < 10) { stat...
[3 replies] Last: jlb - It's works for me, than you for answer. (by Elektromann)
by Foxel
Cout of unsigned char
 
I'm using Visual Studio 2019 : why does this command do nothing? std::cout << unsigned char(133); It literally gets skipped by my compiler (I verified ...
[1 reply] : Hello Foxel, I ran this through my VS2017: #include <iostream> #inc... (by Handy Andy)
Printing edge/corner coordinates of triangulated convex/concave polygon in the right order
 
It's about convex and concave polygons, triangulation is already done: every coordinate pair of x,y lies at an edge/corner. Polygon array consists of n trian...
[1 reply] : Solved in this thread: http://www.cplusplus.com/forum/beginner/267765/ (by Bronislaw)
February 2020 Pages: 1... 910111213
  Archived months: [jan2020] [mar2020]

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