Beginners - August 2018

queue of vector insert
 
how to insert value to queue<vector<pair<int,int>,int>> q; I tried q.push({1,2},3) but getting error.
[1 reply] : queue<vector<pair<int,int>,int>> q; The premise of your question doe... (by Ganado)
by AL88
Can anyone help me fix these 8 errors on this string class
 
can anybody help me fix these 8 errors on this string class. Ive tried to copy it out of my programming book word for word and checked it again but I can't fin...
[1 reply] : 1. const * char doesn't make sense. See: https://stackoverflow.com/q... (by Ganado)
file handling
 
Hi, I was under the impression that, when one uses a project in an IDE, it is sufficient to "add file to project" all the needed header files and .cpp files of...
[5 replies] Last: Just adding my code: main: #include <iostream> #include "C:\Users\Re... (by PhysicsIsFun)
3 partitions of equal sum (1,2)
 
I want to write a function that shows if it is possible for given vector of positive integers to be divided into 3 subsets with equal sums. As I understand I ne...
[28 replies] Last: Here's a version that prints the sequences and uses less memory than t... (by tpb)
User creating txt files.
 
I've been working with text files for a bit and I am wondering if there is a more efficient way for the user opening a txt file. #include <fstream> usi...
[2 replies] Last: the trouble with this is that about 50% or more of all text files do n... (by jonnin)
Does it cost to learn?
 
I have six months to learn to code in c++. I choose c++ because it seems good and is compatible with cocos2D which also looks great! My learning plan is: ...
[3 replies] Last: Programming is 99% problem solving, you can learn how to decode how a ... (by poteto)
Slot Machine Practice Problem
 
Hi all I am writing a slot machine program as part of a book i am following. It wants me to randomly display the results of the slot machine to the player, h...
[4 replies] Last: slotVal should be a member of class slotMachine. I think slotMachine ... (by dhayden)
is <windows.h>'s system("color 01") cool to use?
 
Hey guys,I was just getting to know formatting output options in c++ and came upon the color() in windows library. Thing is i've been told many times to avoid ...
[3 replies] Last: well, just to put it out there, there are also the ncurses library ( p... (by Flaze07)
Output Problem - Windows. library
 
Hey Guys,I have been playing around with <windows.h> today and encountered the system("color 01") function,I decided to give it a go on a program i had made rec...
[1 reply] : I told what the 'color' is in your other thread: http://www.cplusplus.... (by keskiverto)
Switch Case - Problem Going Insane
 
Hey all, I cannot figure out what is wrong with my switch case. Case 1 seems to be working. But case 2 and others aren't. Here is the code: #include...
[5 replies] Last: when I press number 2 on keyboard it will not display I don't see t... (by Jaybob66)
Function pointers: trying to pass a function as an argument
 
Hello, my program works ok when I pass to the function simpson all four parameters as doubles and ints, but because I need the last parameter to be passed as a ...
[4 replies] Last: I can't add simpson function to my source.cpp file. it has to come fro... (by aurimas13)
INCOME CALCULATION
 
Hi all, i am facing difficulty in understanding the question given below, specifically the one which i have put in quotes. A rate of $10 per hour applies for...
[1 reply] : If you work 40 hours, you get paid your hourly rate times 40. Let's ca... (by helios)
by ccox86
Complex numbers operator help
 
I'm completely stumped as to why I can't get the ostream& to run correctly.. I think it may be the simple math I did in the main function but I'm fairly certain...
[2 replies] Last: Ohhhhh Wooooow... I can't believe I didnt notice I was missing () on t... (by ccox86)
Classes and object arrays organizing a test questionnaire
 
My question pertains to a school assignment, and I want to emphasize that I am not looking for someone to just give me the answer. However, I am looking for dir...
[3 replies] Last: #include "TestBankMC.txt" #include "TestBankTF.txt" This looks suspi... (by Repeater)
Displaying combinations of string without repetition with the help of circular queue
 
Input : n= 4 PRSW Output : RSWP SWPR WPRS PRSW
[2 replies] Last: so the order is fixed and the starting point varies. easy enough. th... (by jonnin)
Template: Multiple choice
 
I want to create a multiple choice/rpg text game type template from scratch. I want to use pointers to allow there to be a pointing to different cases. I don't ...
[no replies]
Syntax errors
 
My Console has to display state of Bool Status , if that is False it will display in Red Color(12) Off ,if that is True it will display in Green Color (10) On. ...
[4 replies] Last: Thanks and for bad question It seems like I dont use my brain . :( (by Jovanovic)
Partition Sort for single linked list to double linked list
 
I have code for partition sort for single linked list It sorts next pointers correctly but i want that this function be able to sort double linked list als...
[13 replies] Last: To test it, write a function to print the list using the next pointer,... (by dhayden)
by koce
Dynamic memory release problem in VS2017
 
Hi, guys, I did a merge sort function for integers, it works fine in online compiler, but crashes in VS2017 at the moment of dynamic memory release. ...
[7 replies] Last: When you write outside the heap-allocated array, you might be changing... (by dhayden)
by arioX
GCC wont link statically
 
Hi guys, i dont know where to post this question so i am sorry. But i need help. I am using Jetbrains Clion and TDM-GCC which contains gcc5.0. But i want to use...
[no replies]
August 2018 Pages: 123... 15
  Archived months: [jul2018] [sep2018]

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