Beginners - October 2021

by jabeh
how to make class and object methods but still output the same. //include the neccessary headers #include <iostream> #include <fstream> #include<stri...
[7 replies] Last: oh no i mean to create a class The brief basics of creating a struct... (by George P)
by Paul5
Problem in File handling and 2D array
Task1: Construct a program to load all unique words of a specific file in an array and display them. Task2: Construct a program to load and display all wo...
[2 replies] Last: [Continuation of this thread (by seeplus)
Do while loop prints only one number instead of 10
I put the condition that until x is equal to -10 keep on decrementing. Why does the code only display 1? #include <iostream> using namespace std; int ...
[8 replies] Last: LOL. Sounds like this is taking on a life of its own. Perhaps someone... (by againtry)
Read Files
Looking for help on this assignment cause i'm new to c++. Can anyone help me out with figuring this out? how to read multiples files with void prodecure? i'm ge...
[2 replies] Last: thank you so much for your help, now i know what should i do :) (by masninoeh)
by nodoz
virtual functions
if I make a virtual function in the base class it does not seem to matter if the derived classes have the virtual keyword or not for that overriden function. th...
[2 replies] Last: ok thanks for the reply. (by nodoz)
Completely lost
My task is to define a function that accepts i as as an argument to compute the following summation, return the summation from the function m(i) 1/2 + 2/3 + ...
[5 replies] Last: ... (by againtry)
by chipp
const variable syntax (1,2,3)
i just read a code with different declaration of const , e.g.: int const* num1; int const* const num2; what's the meaning of those? and how could c...
[52 replies] Last: const does not do anything actively, to my knowledge. - it lets the c... (by jonnin)
Associative array map with key
Hello guys, can you help me with this struggle. CPP program I have to create a Invoice class who have to contains these fields: 1. List of purchased goods - a...
[3 replies] Last: As a starter, perhaps consider: #include <string> #include <iostrea... (by seeplus)
Placing Functions inside class vs outside
I see that a function can be coded directly in side a class--or--a model/header can be defined inside the class an the body of the function defined outside the ...
[3 replies] Last: One caveat is that it can make a difference if you don't have LTO (L... (by Ganado)
Secant Method error in code
Need some help with a code I am writing for school, its almost working but i've got an error on line 31 and not sure what to do, error is (|31|error: cannot bin...
[4 replies] Last: span a root? Realistically, your method is only going to work if f(x... (by lastchance)
Passing pointer to an array into a function
I'm an experienced coder but relatively new to C++. I took a C course maybe 35 years ago but have worked with it only sparingly since. I read the "read befor...
[5 replies] Last: You can also pass by templated reference: #include <iostream> temp... (by seeplus)
problem linked list.
Hi guys, so here is my task : Write a program that creates a simple linked list of N integers taken from the INPUT file. The last number entered is one. These ...
[2 replies] Last: You first need to open the file std::ifstream ifs("INPUT.txt"); if ... (by seeplus)
Divination Calendar/I-Ching Program
I am using I-Ching/Mayan(Tzolkin) calendar ,on this calendar each day the entire set up get changed for example from two sixty days today is the first day and t...
[1 reply] : I see a<10,b<17 as a potential problem. You may read more about C++ ... (by kevinkjt2000)
by Vladek
Columnar transposition in C++ (1,2)
I found this code on the Internet together with a movie, where it is shown how it works (and on the movie everything works fine), but it doesn't quite work for ...
[21 replies] Last: You're so vain, I bet you think this post's about you. (by The Grey Wolf)
Can't bubble sort char 2d array, gets segmentation fault 11
So I get segmentation fault 11 if i try to use bubble sort on this 2d char array. It should read a file that is comma-delimited like this: Rico, Suave Migos,...
[8 replies] Last: change to int i = 0; and int j= 1; type initialization then. You nee... (by jonnin)
Hi can someone help me with this? I'm sorry I don't really understand this. Given a string consisting of lowercase letters and question marks, s1, and anothe...
[3 replies] Last: Oh right now I understand it thank you for the clear explanation good ... (by Shavana)
if ( ) + side effects
Hi together, in a book I came across examples that demonstrate the behavior of if-structures when the condition expression has side effects. The author claims ...
[16 replies] Last: This questions is (sic) simply about how the language works. Really?... (by againtry)
Can't fill in 2d array from comma-delimited text file
So basically my text file looks like this: Rico, Suave Erden, Alperen Mac, Crip Migos, Quavo I'm just trying to fill up a 2d array with the names. When I ...
[6 replies] Last: They are actually delimited with comma and then a space. @OP How is... (by againtry)
If else
How i make the code to read all the conditions before making decision if ((S1 == S2) || (S1 == S3) || (S2 == S3)) { cout << "Segitiga sama kaki"; } ...
[3 replies] Last: How i make the code to read all the conditions before making decision... (by againtry)
Formatting Question!
How would you go about creating a grid like this? ------------------------------------------------------ |10 |11 |12 |13 |14 |15 |16 |17 |18 ...
[2 replies] Last: ------------------------------------------------------ |10 |11 |12 |1... (by againtry)
October 2021 Pages: 123... 7
  Archived months: [sep2021] [nov2021]

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