Beginners - April 2021 (Page 10)

Printing array and adding
Hello, I'm having trouble with my array assignment. The instructions are Create a integer type two-dimensional array of 4 rows and 3 columns Populate the two-di...
Apr 7, 2021 at 5:40pm
[10 replies] Last: Sorry for the late reply but thank you for teaching me about uniform i... (by av16352)
Need help with a "general" if statement c++
okay, so basically i want to make something like this: Say i have an if statement with a string like this: getline (cin, string); if (string == "hello my name ...
Apr 7, 2021 at 2:15pm
[2 replies] Last: Prefix and suffix of string are relatively easy with substr(): http://... (by keskiverto)
Store backroom
Hello guys i am trying to build a "grocery backroom" here is where i want the user to enter an item and store it in one of the aisles in the back. So for instan...
Apr 7, 2021 at 1:23pm
[5 replies] Last: Hello rezy3312, When I got the program to run I tried this: ------... (by Handy Andy)
list
help me understand how to add, multiply or make any other simple math. operations with lists STL. elements Sum=list +list1 ...listN list <int> L(7); ...
Apr 7, 2021 at 12:46pm
[3 replies] Last: Or possibly like this: #include <list> #include <iostream> #include... (by seeplus)
Find data from file and assigning to struct members
Hi guys, I need some insight on my code here, So I have a file that have the following stored: username password name mobile ic In this part of my code...
Apr 7, 2021 at 10:16am
[12 replies] Last: That would be the easiest - assuming that mobile and ic also don't con... (by seeplus)
Header Files and Private Variable Usage
Hello! I'm trying to create a header file for my upcoming project. This is my first time actually using classes so I'm not quite clear on all the do's and don't...
Apr 7, 2021 at 10:12am
[8 replies] Last: R L86 L89 above, == is equality test, = is assignment. Also pass strin... (by seeplus)
operator overloading, and some other basic stuff
i am doing an exercise - a library software, which takes book names, ISBN in form n-n-n-x where n is integer and x is integer or letter and other details. 1.h...
Apr 7, 2021 at 8:34am
[5 replies] Last: @AbstractionAnon thanks . I fixed the points u mentioned except line 1... (by Reddevil1003)
by Day532
Permutation in c++
Hello there all, I am new to c++. Be that as it may, chipped away at python. Need to change over the python code bit to c++. Instructions to mimic the python ...
Apr 7, 2021 at 7:58am
[1 reply] : http://www.cplusplus.com/reference/algorithm/next_permutation/ (by lastchance)
For loop prints 0, after i++ increment expression!
How come: it prints value 0 for i, if based on definition of for loop, i++ will increase i from 0 to 1, before loop beings??? I cite: "Like the while-loop, thi...
Apr 7, 2021 at 4:55am
[9 replies] Last: What do you mean, "outdated"? The explanation you pasted there is corr... (by helios)
Using C++, write a class BooksInfo
Using C++, write a class BooksInfo which has the following attributes: Book_Title, Book_author(s), Book_publisher, noOfCopies, ISBN, price, and Publication_Year...
Apr 6, 2021 at 7:00pm
[14 replies] Last: Hello mar1972, Using C++, write a class BooksInfo which has the fol... (by Handy Andy)
Enum help
So I'm just doing a simple code to show use of enumerations in a code of our choice. I kind of understand how they work and I'm just doing a simple code where y...
Apr 6, 2021 at 4:24pm
[2 replies] Last: #include <iostream> #include <string> #include <limits> enum weekDa... (by seeplus)
password hint
Hey guys im wrting a code but ran into a problem, i am asking the user to enter the password that is random from an array. For example if the hint of the passwo...
Apr 6, 2021 at 3:46pm
[5 replies] Last: yes but i wanted to compare 2 arrays with the same that way i just add... (by rezy3312)
Average array
Let me preface this, im a noob in an intro level c++ class. Here is the problem Create a 2-D double array with 5 rows and 4 columns. Each row should ...
Apr 6, 2021 at 12:59pm
[11 replies] Last: what I'm still not understanding is how to call the variables in the ... (by dhayden)
Small 'Matrix' Game
Appears that the original owner has done a bunk. If you don't supply runnable code then people can't reproduce your problem. You had better decide whether p...
Apr 6, 2021 at 9:31am
[4 replies] Last: The code uses a variable called line - which isn't defined! eg if (li... (by seeplus)
How can i clean my messy code
Hi everyone. Im a newbie, because of that i apolige. I have a messy code. I want to clean it and want it shorter. How can i do it? if(item->parent() == g...
Apr 6, 2021 at 1:12am
[5 replies] Last: When one replies to a thread it appears at (is "bumped") to the top of... (by mbozzi)
Dynamic Array
Hello I'm getting an error in the implementation of my push back function to append values to a dynamic array of floating points type double The function shoul...
Apr 5, 2021 at 9:03pm
[6 replies] Last: Makes sense! Thank you! (by panconcafe)
make member variable immutable after constractor
In other langs like Java there are keywords like 'final' where a member variable suffixed by 'final' is immutable after the construction of the object I know ...
Apr 5, 2021 at 10:25am
[9 replies] Last: No. A variable can only be set as const when it is defined. You can't... (by seeplus)
Array with copy
Hi guys happy easter, This is what I am trying to accomplish Create a 5-element array Initialize the array with 1, 2, 3, 4, 5 Print the contents Create...
Apr 5, 2021 at 8:45am
[3 replies] Last: #include <iostream> #include <valarray> using namespace std; templat... (by lastchance)
Resize function in STL Vector
When I searching for resize function of the STL Vector, I find some of the words says that this function may change or delete some members in my vector or add s...
Apr 5, 2021 at 7:45am
[4 replies] Last: Thanks for reply. (by VoidWalker)
if control statement
hey, I am working on project and I want to make the person choose and enter what he like to see and eat during movies the problem that it stops after I enter "...
Apr 5, 2021 at 1:14am
[6 replies] Last: You don't need braces in case statements for most uses. Only when a v... (by deleted account xyzzy)
April 2021 Pages: 1... 89101112
  Archived months: [mar2021] [may2021]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.