Beginners - September 2020 (Page 6)

by Mif
C. How to check if the file is empty ?
I ran the code and it works I get the message when it has no content, but when the file is NOT empty I get the same error message "No information in data".. wh...
Sep 16, 2020 at 5:26am
[9 replies] Last: Also note that on Windows, _stat and _stat64 (there are many variants,... (by lbrandewie)
No _stat or _stat64 return on System Volume Information file
Hey Folks, I'm getting a strange result. I've been using _stat and _stat64 (there are many variations on these functions, these are the only two I've tested) to...
Sep 16, 2020 at 5:23am
[14 replies] Last: OK, I'm marking this as "solved" at this point as I don't think I'm li... (by lbrandewie)
by Joello
Problem with Nested Classes
Hey guys, it's been over a year since i've used C++ or done much programming at all, so i apologize for my stupid question but i feel i'm just stuck on some bas...
Sep 16, 2020 at 3:28am
[4 replies] Last: Depends on what you are after. For a constructive flow try inheritance... (by soapbar)
invalid use of non-static member function ‘int Die::roll()’
So, I've started writing a turn based text game, and I'm having difficulty taking my random number made in 1 class, and using it with another. I got rid of a lo...
Sep 15, 2020 at 8:22pm
[11 replies] Last: Have fun! (by seeplus)
Interleave help
I have a program thats suppose to take an infile message and decipher it. I'm unsure how to make this work with the current setup that I have. SPEC Sheet CS...
Sep 15, 2020 at 6:31pm
[1 reply] : Infile data: endloop CS yourqueue.enqueue(str); 372 str; Program >> ... (by CodeNovice01)
difficulties translating a random number gnerator to a header file and classes to call from main program
I wrote a simple random number generator that outputs from 1 to 4, but I can't seem to wrap my head around how to put it in a class header file dice.h #i...
Sep 15, 2020 at 6:04pm
[4 replies] Last: For a C++ approach using <random> and <chrono> a simplistic [and w... (by deleted account xyzzy)
by Daerk
How will I be able to create an array of 10,000 random integers?
We were given the starting point for the timing function to record the elapsed time for three sorting algorithms (Bubble, Insertion, Selection) and don't know h...
Sep 15, 2020 at 5:05pm
[5 replies] Last: I thought it was a 'test how long pow takes' question, is why not use ... (by jonnin)
Cannot get decimal precision to work
I have to make this program for class that takes a plumbers wage and calculates the total repair cost based on several variables/constants. But I cannot get the...
Sep 15, 2020 at 1:35pm
[6 replies] Last: When I run the program, instead of giving me some correct answer like... (by keskiverto)
Date comparsion problem
Write your question here. #include "stdafx.h" #include <iostream> using namespace std; class Date { private: int Day, Month, Year; public: D...
Sep 15, 2020 at 11:31am
[4 replies] Last: I did miss lastchance 's beautiful ninja: if ( Year != compa... (by keskiverto)
by Rlabee
Redefinition and uninitialized memory failures
So right after seeplus helped me with my previous problem (which was pretty lame on my side) another problem occured. It has to be something i completely mi...
Sep 15, 2020 at 9:51am
[7 replies] Last: Couple of further points - if a problem is detected which isn't allow... (by seeplus)
Error Accessing the constructor
Hi all, The ERROR says calling the private constructor of the class is private within the context. What does that mean? How to call the private constructor o...
Sep 15, 2020 at 4:59am
[5 replies] Last: Thanks again @lastchance The copy constructor suggestion had really w... (by Shruthi LS)
Failure to compile raw string literals for ascii art
So I'm trying to use ascii art in a game I'm writing for terminal, and the slashes cause errors because they are escape sequences. Supposedly using raw string l...
Sep 14, 2020 at 7:23pm
[5 replies] Last: sweet, your mud is nearly ready :P (by jonnin)
by Rlabee
no operator >> matches these operands
I am trying to write a program which counts money and transfers it into bills. So lets say for 88 euros it will say you need 1 50 bill, 1 20 bill, 1 10 bill, 1 ...
Sep 14, 2020 at 3:53pm
[2 replies] Last: wow, didnt realise it was THAT simple! Thank you seeplus for your ti... (by Rlabee)
Help with fill in code exercise
I have a "fill in the ..." on my online C++ book, where they give some code and you have to fill the ... with the correct code (then you click a Code Chec...
Sep 14, 2020 at 3:09pm
[2 replies] Last: I got it! thank you! (by JamesHelp)
Stuck trying to loop multiple dice multiple times
For this assignment, "Your program will prompt the user to enter the number of dies in a set (4 through 6) that will be rolled together. The sum of the faces on...
Sep 14, 2020 at 2:37pm
[7 replies] Last: How would I create a function that outputs 2% of the highest value in... (by coder777)
Void seems not to work inside Main function
Hi, I just got back to school and I haven't program in years. I got some basic C++ but I have been stuck with this program for a while. I'm writing a program ...
Sep 14, 2020 at 8:28am
[18 replies] Last: Also I'm not quite sure why my instructor asked for a pause while the... (by seeplus)
Move the contents of a ppm file to another ppm file
Hi there, I would like to send a ppm image that is located in an input file, to another output ppm file. And would like to have access to the pixels of the ou...
Sep 14, 2020 at 6:11am
[1 reply] : You want to resize a bitmap image. I would use something like Graphics... (by keskiverto)
project in codeblock
i am a beginner and i wanted to know how the "create a project" feature works in code blocks and when it can be used. i have only worked on a single file in cod...
Sep 14, 2020 at 1:03am
[4 replies] Last: yes, i have codeblocks already installed (by Jaskiran)
Command injection
I want to issue a command while another command is being executed in C++. For example wait command takes time for execution, and during this time I want to inje...
Sep 14, 2020 at 12:28am
[6 replies] Last: Any suggestions on using threads in solving above problem. Thanks (by CodeImpulse)
Sorting array
You have an array with N positive integers, the number of odd values and even values are equals, your work is to arrange them in non-decreasing order. You can o...
Sep 13, 2020 at 10:17pm
[14 replies] Last: #include <iostream> #include <algorithm> #include <vector> #include <... (by dhayden)
September 2020 Pages: 1... 45678... 10
  Archived months: [aug2020] [oct2020]

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