Beginners - April 2020 (Page 14)

by pkdir
Return success value - Best Practice
 
Hi, I have a few functions that load and validate data from a file. If any of the text fails a given condition, I want my program to output an error and termin...
[8 replies] Last: I keep replying in-between you posting haha. So after reading your me... (by pkdir)
by R0SsAN
C++ Obfuscation
 
Hi everyone, I have created a program to search for strings in certain txt files. The .exe would like to put it public but I don't want people to be able to dec...
[2 replies] Last: If you are really paranoid, you can encrypt the incoming text file and... (by jonnin)
totals not adding up
 
Hi there I apologize if there is a solution to this. I have however browsed the forum and have not found something that fits. When running this function t...
[1 reply] : Never mind. I should have initialized total =0; I am leaving this he... (by Mischkedb)
error handling for this method?
 
Hi I'm writing a library where one of the methods of a class has the following signature: UniqueID findCommonIDs(UniqueID first_id, UniqueID second_i...
[2 replies] Last: Is a bad parameter supplied by the user exceptional? https://en.cppr... (by Enoizat)
reading ifstream
 
hey guys for an assignment I have to write the function to numbers from a file. The function was already predefined by my professor with the parameters we need....
[3 replies] Last: Hello clayoda, Given your code: int openAndReadNums(string filename... (by Handy Andy)
Need help ASAP with error client.cpp|58|error: passing 'const Fraction' as 'this' argument discards qualifiers [-fpermissive]|"
 
My program runs fine without my shortcut key input, but when I use my shortcut key input I get this error... its a multi project file so I am going to include, ...
[4 replies] Last: It was my functioncapitalization omgggggg (by Depressed)
Getline won't work
 
Did my own code. Didn't work. Copied instructors code and won't work. They don't know why. Case 1 of this is to read a .txt file: The Wizard of Oz 1939 De...
[12 replies] Last: Some helpful links that also explain this problem: http://www.cplusplu... (by Ganado)
Filling a several vectors from a file with ints and strings
 
I am currently working on another lab and I can't seem to figure out how to fill these vectors with the following input from a text file: 1000 George Washing...
[3 replies] Last: Yes, since it comes in predictably. They likely expect you to see th... (by zapshe)
operator <
 
I am trying to create a program that is an event simulation using the STL priority queue. I created the operator < function inside a struct, but when I run the ...
[5 replies] Last: If the STL priority queue is a templated class, does that mean I have... (by keskiverto)
Reading Multiple Integers from Binary File
 
I am really baffled and cannot figure out what the problem here is. I am writing 3 Integers to a file and try to read them later again. But I get some random da...
[3 replies] Last: For someone who might come in and have a look what I did to fix this ... (by lvlanson)
How to create an array of pointers to object of a inherit class
 
Consider the following code class Shape { protected: int length, height; public: Shape(); ~Shape(); }; class Square : Shape { private: doubl...
[1 reply] : Remove lines 15 and 21. Put lines 7 to 22 within a loop that iterates ... (by Ganado)
by rklein
Traversing Singly Linked List
 
Okay, so I am an electrical engineering major in my senior year. I have some experience with embedded C as a result but decided to take a C++ class in my school...
[3 replies] Last: Please post OrderedList.h and Node.h (by dhayden)
I have a question about dynamic array (c++11)
 
Hi, I'm a sophomore student of CS and preparing for a coding competition, But I meet some problems. My code is here. I run it on Dev C++ 5.11: int *rowt...
[6 replies] Last: Thanks a lot! That solves my question! Awesome explanation! (by hellowarudo)
WM_ERASEBKGND not erasing drawing
 
I want to draw a moving shape, either on WM_MOUSEMOVE or in a Timer. But the old shapes are not erased when I use the following handler: case WM_ERASEBKGN...
[12 replies] Last: Thanks! In combination with WM_ERASEBKGND and return 1 it does not fli... (by bchinfosieeuw)
by annw3y
classes c++
 
I have class Book, which have name, price and barcode. I need to create method bool isSame(Book *b), which returns if two barcodes are the same. How can i do th...
[1 reply] : bool Book::isSame(book *b) { // add code here to decide if (barcode... (by Repeater)
Store List Assignment Help
 
Hi! I'm working on writing a code that's due in a few hours. The code, when given an input like: 1 Stores: Local Grocery East Lansing Apples,10,$4.76 ...
[2 replies] Last: Is making a 3d vector the best way to store all of this information? ... (by jlb)
Loops-Drawing a Tree (C++)
 
Hello. I am working on this assignment and it has been giving me serious grief. I was wondering if I may receive some help. Instructions: 1. Modify the above ...
[2 replies] Last: Thank you! This helps so much! Also thanks for the single loop tip, I ... (by fruhtie)
Stop while loop with virtual key press
 
Hello, i've been working on a program about input and output in a .csv file. It works, but my problem is that i cannot find a way to stop a while loop using a ...
[7 replies] Last: mimic of getch is challenging. Every OS has some way to do it, but c+... (by jonnin)
Small issue with output message in object code
 
Write your question here. The program is suppose to take number of passenger from int main(),and then check the number of first class,eco class and business cl...
[6 replies] Last: Thank you so much all,for your time and help it works finally :) (by hayabusaruler)
by kbw
I need your help please
 
Where are you stuck? How much of it can you do?
[3 replies] Last: i just need the code Here's some code for you: #include <iostream> ... (by deleted account xyzzy)
April 2020 Pages: 1... 1213141516... 20
  Archived months: [mar2020] [may2020]

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