Beginners - October 2020 (Page 3)

What's wrong with my program? (Basic Function Calling)
 
I need to write a program that generates a random question ten times. The program then has to be organized using function calls, as well as, keep track of the a...
[3 replies] Last: int randomQuestion(int correctanswer) { correcvtanswer is pased by... (by seeplus)
Sets Equivalent in cpp
 
What is the equivalent cpp code for the below python code snippet. //Here the left points is the list of objects. left_shapes = list(set(left_points)...
[8 replies] Last: if you need to remove dupes, using a set up front and never fooling wi... (by jonnin)
using goto for game state machine (1,2)
 
I know that everyone suggest that you should avoid using goto, but I don't care if the code is hard to read. Unless it is somehow slow to use goto or something ...
[30 replies] Last: i have done state machines before, like simple character movement. jus... (by darlock)
Program to store 10 contacts having info. Of phonenumber,name and email.
 
I am doing a program store 10 contacts with memberdata phonenumber as cno , name as cname and email as . I am having trouble while giving input in the arr...
[7 replies] Last: Okay and thanks 😊 for your reply (by Xavierprince)
Heap Program - Needs to sort smallest to largest
 
I've written this program and when I compile it, it gives me an output, but the sorting is incorrect. The first "week" is suppose to be the lowest/smallest wort...
[14 replies] Last: Handy Andy, I greatly appreciate all of your input and time. BUT I fi... (by CodeNovice01)
Using a while loop with the eof() function
 
I have to use a while loop and the eof() function to produce the following output: First Name: Don Last Name: Smith Department: Accounting Title: Auditor M...
[5 replies] Last: To properly use what you need try this: or have the extraction once... (by seeplus)
get() overloaded function ifstream
 
hey, I have been learning I/O, and am going over the get() function, I have learned that there are overloaded versions so wanted to try those version, but I can...
[3 replies] Last: (extraction operator >>) (by doug4)
convert to a class
 
Hi, Please, can you help me, i wante to convert or use this code in a class: #include <iostream> // Function to return multiple values using references voi...
[12 replies] Last: ... just like treating 't' as a data member and not as the more approp... (by againtry)
documenting with doxygen
 
For my projects I want to document my code with doxygen. I ask me, where to put the comments which will read out by the doxygen parser. I could put the comments...
[2 replies] Last: If you want to use that kind of tool, I advise the .h file, since that... (by jonnin)
String (Month Name)
 
How to do this same thing with string library? Storing January in 1? Is this possible? #include <iostream> using namespace std; int main() { int num; cout...
[8 replies] Last: Thanks. (by HelpMeBro)
Queue Number System for Clinic registration counter.
 
You are to write a Queue Number System for Clinic registration counter. General requirements are as follows: 1. When a patient comes in, the operator will gener...
[14 replies] Last: Please don't remove your original post. It's not good forum etiquette.... (by seeplus)
Loop the whole program
 
I want to loop the entire program with a "Do you wish to loop through the code again? [Y/N]" type of code. I don't know how to do the sequence I keep getting tw...
[2 replies] Last: BTW you need to properly indent your coding and make good use of white... (by againtry)
c - how to get access to FILE * instance?
 
I was curious about the object which fopen() returns. So I made this little test program: #include <stdio.h> int main( void ) { FILE * file = fopen( "kna...
[11 replies] Last: You can indeed read out what FILE* (a typedef for a struct) is made up... (by againtry)
fopen(): Get file streams automatically closed when a program ends?
 
If I have opened a file with fopen(), need I then close the file before the program exits, or will it automatically get closed?
[1 reply] : After a further search (previously I found nothing about that topic) I... (by nuderobmonkey)
Why this crashes? tiny code for listing all files
 
It doesn't crash immediately, the forloop lists a few file paths then this "Unhandled exception at 0x76F05608 in testpath.exe: Microsoft C++ exception: std::fil...
[10 replies] Last: I've had problems with std::filesystem::recursive_directory_iterator()... (by closed account oivD8vqX)
Caps
 
Is there a way that whether user input "a" in small caps or large caps in console but program runs it as follows instead of writing "a" with both small and ...
[12 replies] Last: I haven't studied a lot of these yet. But thanks. (by HelpMeBro)
boolalpha
 
Hello, I tried to change the number 1 or 0 to true and false. No matter where I put it, seem not to be working. #include <iostream> bool equal_or_not(int a,...
[7 replies] Last: Formatting this gives: if (integer > 0) return integer; else ... (by seeplus)
What to use to store (and work on) lots of data?
 
Time appropriate greetings everybody! I am currently working on a little programm that has to be able to load, save and work on "large ammounts" of data. I ...
[10 replies] Last: For c-style memory index, -ve index is valid (although not for vector/... (by seeplus)
Reading strings from file and putting them in an array (1,2)
 
Time appropriate greetings, I just want some feedback one the general implementation of this: What I am trying to do is create a function that reads strings...
[29 replies] Last: That's mainly againtry's code - not mine. I posted it there re the run... (by seeplus)
Doubly Linked List insertion function not working
 
I am working on a function to insert a new node before a node I had previously returned from another function(complex). However I can't quite get it to function...
[6 replies] Last: > The returned node I was referring to is forFindNext. > That is a poi... (by ne555)
October 2020 Pages: 12345... 13
  Archived months: [sep2020] [nov2020]

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