Beginners - April 2020 (Page 7)

using getline to grab 2 seperate arrays
 
I have a txt file that looks like blah 324342 blah 23423 blah 23423232 ect.. And I am trying to use getline to grab the seperate lines and assign them...
[9 replies] Last: Usually it is just because the professor does not know the modern lang... (by Duthomhas)
Struggling with coding for a assignment question
 
Write a program that will create userids for email addresses of a company. Names of employees will be contained in a file. Your task is to read the file charact...
[7 replies] Last: You don't need to use sstream. I only used sstream to give you an exam... (by TheToaster)
Convert 24 hour format to 12 hour AM/PM
 
Hello everyone, hope you are all safe and sound. I am running a simple program using 3 functions to convert from 24 hours to 12 hours. But I seem to be getting...
[5 replies] Last: Alright, the code works as I want and it works nicely. Thank you for ... (by JohnnyJoestar21)
by skylon
Help with arrays
 
Hi I'm new to this c++ programming and im struggling with this array program. I need to get array looking like this [11,1...
[4 replies] Last: Your loop header should be: while (k != 0 && l != 0); ... (by nuderobmonkey)
Initialize in constructor shared_ptr to map with string and weak_ptr?
 
I have a class Account and two child classes GiroAccount and BusinessAccount.In Account class I want to implement constructors, it look like this: Accou...
[1 reply] : I assume this is what you wanted? #include <string> #include <map> ... (by TheToaster)
by idsuni
Round Counter in (Game in C++)
 
So i just startet with programming and I am trying to make a minigame. One part of the minigame is a round counter. 1 Round = 2 turns (Player 1, Player 2) Ho...
[2 replies] Last: something like: int roundct = 0; while(waiting for a winner or some... (by jonnin)
last value from area
 
Hello all. I am trying to read numbers from a file and put them into an area , that has a max size of 100 elements. (making the numbers up in the file) and I ...
[2 replies] Last: I am trying to print out 4 I am getting a number in the thousands Yo... (by jlb)
Queue help (1,2,3,4,5)
 
Need help with queue program to check balanced parenthesis using namespace std; class isBalanced { string* arr; string FrontNode; isBalanced...
[92 replies] Last: Thanks (by cblack618)
Need help converting Psuedocode to C++
 
Now that our campus has been closed I have no access to the resources I would of before, like a helpful professor. How would I convert this psuedocode to C++ ...
[5 replies] Last: Hello Hello GabriellaN3, I have been working on your program, but I g... (by Handy Andy)
Have I correctly allocated and de-allocated memory for 2 arrays?
 
I had to complete the following task "Write code that allocates memory dynamically to two vectors of double precision floating point numbers of length 3, as...
[3 replies] Last: ^^ ninja'd :) (by TheToaster)
I have written out my C++ but im not sure what the issue is
 
Geraldine’s Landscaping Service and Gerard’s Lawn Maintenance are merging their businesses and want to merge their customer files. Each file contains a cus...
[3 replies] Last: Hello GabriellaN3, [quote=GabriellaN3] Im not understanding why I can... (by Handy Andy)
Assigning a dereference to a dereference
 
The article I was reading at http://www.cplusplus.com/doc/tutorial/pointers/ confused me when I found the following snippet of code around half way into the art...
[8 replies] Last: Wow! Many thanks ya'll. Especially @Duthomhas. It can't be more clear ... (by Xenophobe)
by kmce
Visual studio help
 
Sorry to ask this here as its not really a c++ question, I only know of this site and stack overflow, and i hate asking questions there. I need to do performanc...
[15 replies] Last: I got the static code analysis work. #include <iostream> #include <i... (by thmm)
by hbcpp
Behavior of std::vector::pop_back! Does it really erase?
 
So I am trying to write an implementation that mimics the std::vector the best I can. When writing the pop_back function I came across a behavior in std::...
[7 replies] Last: std::vector asks its allocator for a block of aligned uninitialized st... (by mbozzi)
array question
 
Hey guys I am just figuring out arrays and need some guidance. I made an array of 100 elements but I want to square each element. so arr =0, arr =1, arr =4 and ...
[8 replies] Last: A classic example of overflow/underflow leading to undefined behavior ... (by George P)
Card Game (1,2)
 
I am trying to make a card game war, but I am having trouble getting the deck split between the player and the computer. I have been working on this all day an...
[31 replies] Last: edit (by Shawske)
Class Question
 
When I compile this program it terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr: __pos (which is 4294967295)...
[1 reply] : At line 110, the find_first_of(":", pos) will find the ':' that follow... (by dhayden)
rand between -x and x
 
I everybody, I'm searching for a method to use rand()and srand() to have a randomic number between -x and x. x is a normal double variable... how can I solv it...
[16 replies] Last: [quote=Learner2][quote=keskiverto]Isn't it important what one learns i... (by keskiverto)
casting a vector of pointers
 
first time posting here :) be nice please. let's say I want to do something like this: #include <vector> #include <iostream> struct Parent{}; struct Son ...
[3 replies] Last: at its simplest, a vector of any kind of pointer would do: vector <ch... (by jonnin)
An array of linked lists to be stored in a hash table and then stored in two more linked lists?
 
Our teacher assigned this homework assignment and it is due tuesday. I am not wanting anyone to solve it for me, it is just written so comfusingly and I am not ...
[3 replies] Last: If I'm reading the assignment, it's deceptively complicated because if... (by dhayden)
April 2020 Pages: 1... 56789... 20
  Archived months: [mar2020] [may2020]

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