Beginners - January 2018 (Page 9)

Randomization character in a string
 
...
[1 reply] : ((rand() % 26)+randomID); On the left, a number. On the right, a st... (by Repeater)
Why is there an exception thrown after inserting a new record for a doubly linked list?
 
Hello, I'm making a telephone directory as practice with a double linked list data structure. When trying to select my option to insert a new record after th...
[1 reply] : In the function make_list, you create four TeleType objects. These are... (by Repeater)
multiple float literals?
 
For my CS class I am supposed to design a program that says: Write a program that asks the user how many integers they would like to enter. You can as...
[5 replies] Last: Thanks for the help all. It worked! I had to drop the class though cuz... (by lostBytes)
by clbj
calculate CGPA with recursion help
 
How do I calculate CGPA while only using recursive and with no loops. I know that you multiply the grade by the credit hours and then divide that by the total...
[1 reply] : and then there is this code that I couldn't include: ... (by clbj)
Why can I not fully alter data members of a dynamically added structure?
 
Hello, I am using an insert function to add a node to a doubly linked list after the tail node. When I call a populate function to fill the data members of ...
[3 replies] Last: Hello, I have since tried your recommendations. They've helped me to... (by Shishykish)
Every combination program
 
Hi I did a program for all combinations of numbers and now i want to do the same one for letters, but im really struggle to do one. There is the program for com...
[3 replies] Last: Even simpler. string s("abcde"); do { cout << s << "\n";... (by Thomas1965)
Query OTP c++
 
Hi I would just like to ask. is it possible to write the output into a text file , if my output is changing every 15 sec.? Basically i am supposed to be writ...
[10 replies] Last: #include <iostream> #include <fstream> #include <random> #include <th... (by JLBorges)
Very basic Nested Classes help
 
Thanks guys! I like the idea of making the display() a little more interesting. I'm reading up more on the relationships and purposes of nested classes. Tryi...
[5 replies] Last: Ok, so I have made these changes, but I want to make sure I understand... (by drew026)
by Rodev
make_unique and delete?
 
Hello, I read that we should prefer make_unique over raw pointers. However, I am not sure if we need to delete it or make it nullptr after its usage. For ...
[2 replies] Last: Thank you Repeater! Now it is crystal clear to me! :) (by Rodev)
by nerol0
"Expression must have a class type"
 
So I am trying to make a function that adds a value to an array from another array and it`s giving me this error. void combine_Array(int* arr , int* arr1...
[3 replies] Last: Hello nerol0, My guess at what you may have done and how to fix what ... (by Handy Andy)
by Kestis
Acessing an item of a vector
 
Let's say I have a class like this: class person { string address; int age; }; I could put them in a map. map<string, person> persons; pe...
[4 replies] Last: How would that function know which vector to look in? You'd have to al... (by Repeater)
fstream query
 
Hi Everyone i am a newbie for c++, i just wanted to ask a question about fstream. basically at the moment , I have a program that generates a 4 digit pin eve...
[1 reply] : Open a filestream. Write one PIN. CLOSE the filestream. Open the file... (by lastchance)
Windows search Pixel
 
Hi everyone, as a beginer, after finished some basic course C++, i want to improve my programming skill, so i want to learn something more about game programmin...
[1 reply] : First you nee to find the window of the chrome browser. Have a look he... (by Thomas1965)
How to read a txt file and store it into an array without numbers and punctuation?
 
I'm working on a program that can read a text file and analyze the percentage of each specific words. I've finished all of the functions, but have some trouble ...
[3 replies] Last: It also appears to have a mixture of line endings - some lines have in... (by JLBorges)
Remove all occurrences of a number in an array in C++
 
Supposed we passed in the array {1, 2, 3, 1, 2, 3, 1}, and we wanted to remove all occurrences of the number 3. The resulting array would be {1, 2, 1, 2, 1}, an...
[3 replies] Last: > Does that mean that my code is not right or efficient? You make ju... (by JLBorges)
by user16
cin.ignore() and cin.getline
 
Anyone know how to solve my problem? I want make program that can pass the cin name char name :{'m','r','/','m','r','s'}; cout<<"Name:"; cin.ignore();...
[2 replies] Last: Yeah, thank you for the information, i already solve the problem, than... (by user16)
ignore function
 
Can anyone explain me what is "cin.ignore" is used for in a vary dumb way please? and when I'm supposed to use it thanks!
[1 reply] : Hello unkinkedash, I will give it a try. The first thing you need to... (by Handy Andy)
C-programming
 
Hi, I´ve had some problems completing a program that I´ve worked with for a while now. Basically, i need to read data from a textfile with 30 beers each conta...
[5 replies] Last: This is a project that is supposed to be done in a group. But my grou... (by jlb)
by Kestis
Objects in objects
 
What is the correct way of making objects that contain objects. I'll give an example. A house has rooms. A room has walls. A wall has a color. I might want to...
[2 replies] Last: If I used vectors instead of maps I would need to know the index of th... (by Kestis)
Why won't cin run?
 
I think my problem is pretty obvious but i don't get why. The cin never runs and the program pretty much skips it. Why? int points; while(points < 0 ||...
[3 replies] Last: this is why do-whiles exist. They do the loop body once no matter wha... (by jonnin)
January 2018 Pages: 1... 7891011... 22
  Archived months: [dec2017] [feb2018]

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