Beginners - May 2018 (Page 14)

by sreich
Library management project c++
 
I am writing code for a library management system. Under "case 1" I need to assign the letter "A" to a book after the user has inputted the book name. How do I ...
[1 reply] : I need to assign the letter "A" to a book after the user has inputted... (by Enoizat)
Function takes a ref to a string but not a string literal from the call
 
Hello there folks! I have a problem with some code. My function would be like: void function(const std::string& string1){ //do something here } ...
[2 replies] Last: Just tested your code. It works. If you are having trouble, it is prob... (by Manga)
cannot read white spaces
 
hi everyone , i have to read a text file containing 2 columns , 1 is sort of the instruction and 2nd is the string involced. so i used istringstream for that an...
[3 replies] Last: Please consider what I have done in my example: in >> item >> ws (w... (by lastchance)
switch and read text file
 
Hi Everyone , i am trying to read a file test.txt that has 2 columns. the 1st column serves as an intruction and the 2nd column serves as the value. but note th...
[4 replies] Last: HI Everyone thanks for the suggestions, I manage to read the set of in... (by paulpv278)
How does including libraries work with classes?
 
Hello, so if I create a class, but I use a headerfile for the declarations, and an additional CPP file for the functions, constructor and deconstructor, how wo...
[2 replies] Last: In general, only use #include's where you need to use them. And also, ... (by Ganado)
Reading file of data, each column with unknown number of spaces
 
Hello, Imagine you are given a file of data about movies. It is written in such file where it was created. In that case, it might be "Germany" as well as "Gr...
[4 replies] Last: Thank you! (by arczi w)
Need help formatting this table? It's almost perfect...
 
"Electric sander" is the longest string and it makes the table print off center. Here is a picture of the table now: https://i.gyazo.com/63285171300f83cb232...
[3 replies] Last: Right, got that confused, thanks for the correction. I agree, best to ... (by Ganado)
Single entry edit in Random Access file
 
Getting crazy over it while i'm pretty sure it's quite easy to do T_T As the title claim i have a random access file and would like to edit only 2 entry of a...
[5 replies] Last: After the polish and some fix ( it still has some bugs when creating a... (by Deneviel)
by Thesar
How to copy a pointer List to another pointer list?
 
I have a template class containing a pointer to a list, the constructor for this class takes in a pointer List as parameter, but i am stuck in how i copy the pa...
[9 replies] Last: OK, but then it will not be able to point to objects of the derived cl... (by Peter87)
2 dynamically allocated array that form a thrid
 
Write a program that declares two dynamically allocated arrays of integers and appends the second array at the end of the first one to form the third one Ive...
[1 reply] : allocate A allocate B allocate C that is as long as A and B together c... (by keskiverto)
dynamically allocate an array and print content in reverse
 
I need to Write a program that dynamically allocates an array, enters its content from the keyboard and print its content in reverse order i am able to print it...
[1 reply] : So what have you done to print the array contents in reverse order? B... (by jlb)
Trying to make a selection sort for my user class array
 
I am trying to sort my array of data type "Invoice" in ascending order by partDes (the string element). I am getting alot of errors, but I feel like I am close....
[3 replies] Last: If you do want to swap invoices with invoices , then do so: std::swa... (by keskiverto)
File sort and linked list
 
I am having trouble understanding how to create a code where it takes in two files and uses the info from the two files to generate a new file. The first of the...
[5 replies] Last: FurryGuy-Hi, I would like to use the std::list but my assignment requi... (by angchan)
Change insertion sort to descending instead of ascending?
 
I am using an insertion sort on an array of objects. I have it working right now, but it is in ascending order and I want descending. How can I fix this? vo...
[1 reply] : I think you just need to reverse the test in the while loop while (j... (by tpb)
Why is my [i] counter giving me this error?
 
I am trying to calculate the total cost per item (quantity * price) but my counter variable is giving me this error: Any help would be greatly appreciated! I us...
[2 replies] Last: Perfect answer, thank you! (by stormbot)
Need help with insertion sort... think I'm close?
 
I am trying to sort my array in descending order by Price. The array is data type "Invoice". I have never used an insertion sort (yes I have to for my assignmen...
[1 reply] : I solved this on my own, but for anyone having this issue... I changed... (by stormbot)
Efficient way to fill a 2D Array?
 
The function "arrayFill" fills a 2D array with a sentence the user enters, and it works. I was wondering if their is a more efficient way of doing this? ...
[1 reply] : I was wondering if their is a more efficient way of doing this? Well... (by Enoizat)
by sreich
If statements, multiple choices
 
When I run the following code I get the error "Code will never be executed" at the beginning of the second 'if' statement. How do I fix this? #include <iostr...
[3 replies] Last: if (choice == 'f' || 'F') { This doesn't mean what you think it mean... (by Repeater)
No Match for operator <
 
I got this error message from the compiler: no match for ‘operator<’ (operand types are ‘const VP’ and ‘const VP’). The problem is I actually implem...
[3 replies] Last: It should be possible to implement it as a member function. I think th... (by Peter87)
VS 2017 community
 
I am just asking these questions in head of time: 1)Will I be able to include Graphic.h in a project with VS community 2017?. 2)If this can be done would yo...
[2 replies] Last: Something close to graphics.h is WinBGI. https://github.com/Duthomhas/... (by Thomas1965)
May 2018 Pages: 1... 1213141516... 19
  Archived months: [apr2018] [jun2018]

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