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...
[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...
[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...
[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...
[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...
[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...
[4 replies] Last: For a C++ approach using <random> and <chrono> a simplistic [and w... (by George P)
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...
[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...
[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...
[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...
[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...
[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...
[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 ...
[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...
[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...
[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 ...
[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...
[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...
[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...
[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...
[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.