Beginners - April 2022 (Page 4)

Problem with COMPILER version !!
 
Hello everyone, Hope all are doing good. I'm a beginner One of my reference code found in 1977 journal was written with PL/I language. In order to understand t...
[10 replies] Last: Perhaps you should use different command line options on the PL/I to C... (by dhayden)
getline() outputting extra whitespace after certain objects
 
I am creating a program for my class project that reads in a string text file, parses the data into objects then stores into a vector. The file is simply a cour...
[11 replies] Last: Zybooks. I go to school online, so it's a weird one. Typically try to ... (by nycmcc27)
which values does the c variable keep inside it? - C++
 
Hello, I have the following code. Our instructor told us, which values does the c variable keep inside it? I wrote: 2-3-4-5-6-7-8-9-10-11-12-13-14-15 (be...
[4 replies] Last: Ask the professor how the value of c can decrease when the only code t... (by dhayden)
Problem with program output
 
I am currently working on a program that will read in the contents of a file to a struct and display the following Student Name: Average Score: Letter Gra...
[5 replies] Last: Thanks for the pointers, I've managed to figure it out and have it wor... (by Cloudfrost)
Array not allowing data entry using ifstream.
 
Hello, I was writing this code where it basically reads integer values from a text file in one function, and then takes another function to sort out how many ev...
[2 replies] Last: Perhaps the file did not open or a read did fail. Those can be tested:... (by keskiverto)
String Search
 
Hello, I am facing some type of logical error. My program is for chapter 12 challenge 6 for Starting out with C++ 9th edition. The logical error is when af...
[6 replies] Last: I am gone a bit over board when I written some of my variables. Which ... (by studentUser23)
Classes and Constructors
 
Hello, I'm still new at classes and I was wondering how I would go about this program. I have most of the getters and setters so far but I don't have the getDat...
[18 replies] Last: Try this: #include <iostream> #include <iomanip> #include <string> ... (by seeplus)
by n00b1e
Nested class error (Variable has incomplete type)
 
I wrote my vector and inside my class I also have iterator class. template<typename T> struct Vector { class Iterator; Vector &insert(Iterator i...
[3 replies] Last: template < typename T > struct Vector { class Iterator ; // decl... (by JLBorges)
Randomized SkipList Implementation
 
Good Afternoon! I'm currently implementing a randomized skip list and don't know what's going wrong here. My insert function isn't inserting. Here is my ...
[12 replies] Last: Thanks a lot, that was the problem!! Oh wow, i think i wouldn't have f... (by Mae4ashy)
is it possible to return 2 values from a function
 
for my functtion twoPlayers() I want to return the winning player and the winning score to main. I was wondering if I could do an if/else with one returning one...
[6 replies] Last: As only 2 values are to be returned, there's also std::pair as well as... (by seeplus)
by Geckoo
Populate an array with Vector2
 
Hello everyone. I have a problem, but it seems to me that it is just a question of semantic. I missed something in my expression. I am trying to populate direct...
[7 replies] Last: Ok. I understand now. Thank you for your explanations. I though that ... (by Geckoo)
by Pen72
Improve time efficiency
 
The code shows terminated due to time out after five cases and also one aborted call case, what can I do to improve? Thanks in advance. Given an undirect gra...
[1 reply] : what to say... you can try to find an algorithm yourself, which is ch... (by jonnin)
Passing 2D array to a function
 
I am working on a Homework assignment and have to pass a 2D array to a function. Can anyone help me with the correct syntax on how to do this? I keep getting er...
[7 replies] Last: Perhaps something like: #include <iostream> constexpr size_t numRo... (by seeplus)
How do I call different variables from one function to another?
 
So, here's the issue. I was told to make a basic calculator with Addition, Subtraction, Multiplication and Division functions. The program will first take the ...
[2 replies] Last: Based upon the OP design, then possibly something like this: #inclu... (by seeplus)
My getline is making me skip a cin
 
The title doesnt really make sense but basically when I run my program, and I try to cin playerOne and playerTwo, it doesnt let me assign a string to playerOne,...
[9 replies] Last: true that, thanks so much for your help man! I will post again if I ... (by BigNibs)
vector pointer to an element (1,2)
 
Could someone help me understand the return of the function. Isn't a vector like an array? return &(*pVec) ; Isn't pVec already the value in i, so why do...
[26 replies] Last: Do you guys remember when you first started, did you have trouble wi... (by jonnin)
having some trouble with this one
 
Hello guys I an having some issues with this program. It will compile but will but keeps giving me errors. (invalid temparture value) I will appreciate if some...
[7 replies] Last: Possibly: #include <iostream> constexpr size_t MONTHS {12}; struc... (by seeplus)
Constant class objects amount?
 
i have a class called employee and i am trying to create multiple employees from this class based from a text file. I can add/remove employees from the text fi...
[6 replies] Last: to clarify, you would have another class that will manage the employ... (by ne555)
Get sizeof(unsigned char *) (1,2)
 
I have 2 functions that should send raw data to a socket connection. I know that writing to a socket is done with `write(sfd, buf, buf_len)`. The first funct...
[20 replies] Last: void dbSend(const unsigned char *raw, int size); void dbSend(string i... (by ne555)
Structure member finding
 
Hi, I am beginner to C++. I would like to know if I can find all members of a structure when I have no information about its members. The reason for asking...
[4 replies] Last: basically what they said, with some more.. first, visual studio is yo... (by jonnin)
April 2022 Pages: 1234567
  Archived months: [mar2022] [may2022]

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