General C++ Programming - September 2016 (Page 17)

by Dkob1
Quick function questions?
 
Is this a generic function of a function template? template <typename T> T lowerNumber(T x, T y) { // returns the lower number of x and y return (x < y...
[2 replies] Last: ok thanks (by Dkob1)
Find value (vector vs unordered_map)
 
Hello, I'm working on a program that aims to backtest quantitative strategy and after looking at the performances of the code, I see that more that half of ex...
[1 reply] : std::unordered_set http://en.cppreference.com/w/cpp/container/unorde... (by JLBorges)
can some do this for me ASAP.?
 
1. write a code which deletes the previous of the last element in a linked list 2. write a code which for a given sentence by the keybord(in a stack S) will ...
[no replies]
Can anyone help me with this?
 
Unfortunately I'm way behind due to some personal issues and this assignment is due tonight. Can anyone help me? My assignment is as follow: Write a program ...
[no replies]
How to manage an array of pointers to a struct
 
Firstly, I have to tell you that I am a beginner in the subject of pointers. I have the following struct: struct Item { Item* nextPtr; int intKey; ...
[1 reply] : std::vector<Item*> HEADS; // empty list // When you have a new list:... (by keskiverto)
by mb20
Need help with comparing and incrementing values
 
-Create two clockType objects: cellPhoneClock and myComputerClock. -Prompt the user to enter the times for both clocks. ...
[4 replies] Last: clockType cellPhoneClock; clockType myComputerClock; (by mb20)
Perfect forwarding
 
It is my understanding that if you use T&& and std::forward<T> with templates, you create perfect forwarding, in that you can pass both lvalues and rvalues to a...
[4 replies] Last: Ohhhhh. That makes sense, thank you. (by shadowmouse)
C++ Create and Rotate an ASCII picture 90 degrees of USM
 
, write a program to draw a ASCII picture of “USM”. Then rotate the picture for 90 degrees. #include <iostream> #include <fstream> using namespace s...
[1 reply] : i need help getting started from this point because its not working to... (by robertmullisd)
Need Help with Input Validation Loop
 
Hey everyone I am having trouble with my magic eight-ball program and any help would be greatly appreciated. 1. Magic Eight-Ball Program: Write a program that a...
[4 replies] Last: Oh so I don't even need to have the do statement, OK this helps a lot.... (by Jdeleon8)
by mvgnum
Allocation function
 
Hello y'all. I need help with a function. I am asked to write a function that allocates memory and store data in an array of integer. I have to use base offset ...
[1 reply] : If you want a two-dimensional dynamic array you only need a single dou... (by mbozzi)
by Kyle M
errors! (1,2)
 
Hi I got bumped back in my progress because I am getting a bunch of errors. Ok I fixed some errors but still complaining about conversion for shared ptrs. I am...
[26 replies] Last: Ah not sure why there was a parameter on the display function, maybe f... (by Kyle M)
SFML wiht Code::blocks
 
HEY people, i was having trouble with SFML in codeblocks so can anyone teach me how to make it work (or being able to run SFML codes?) Because I've searched ...
[1 reply] : Have you tried following the instructions on the SFML website? If you ... (by Peter87)
Find Substring between two symbols.
 
Hello all, I am new to c++ programming. I need some help, I have string : ---- Input : "Name : $$ Enter Your Name2 $$" I want to extract string betwee...
[1 reply] : You are handling a string. Look at the definition of a string! http://... (by closed account 48bpfSEw)
function template throws errors on <
 
(g++)error: expected initializer before '<' token namespace str { template<class S> S str::localestringlower<S>(S s) { ... } } how wo...
[4 replies] Last: This is ambiguous, and the error diagnostic points out the ambiguity: ... (by JLBorges)
by mvgnum
Help to finish my code
 
Hello guys, I found this exercise online and i need to do it for my class. Write a program that implements the following diagram: http://i66.tinypic.com/2h7n...
[2 replies] Last: kemort it's a link to our c++ online class. Only the student of the cl... (by mvgnum)
is this possible?
 
Hi I don't know if this is possible but if you enter something like /23, Will you be able to ONLY detect / so a new line of code would run? Its especially use...
[8 replies] Last: oh check out my post in LOUNGE board :) (by closed account iz8p4iN6)
Count first digit on each line of a text file
 
My project takes a filename and opens it. I need to read each line of a .txt file until the first digit occurs, skipping whitespace, chars, zeros, or special ch...
[15 replies] Last: (Character by character will work but is not best suited to the doubl... (by cire)
Two interger adding, subtracting, dividing, and multiplying program
 
I am having trouble figuring out how to go about adding the math operators to this code. #include <iostream> #include <iomanip> using namespace std; i...
[no replies]
Comparing strings always returning false
 
I'm trying to compare a substring to a string that I have written, like below, but the if statement is always returning false for some reason. if(string.s...
[3 replies] Last: substr() (sometimes called mid()) is a common string operation in many... (by helios)
by Orrin
Made 4 function calculator using if and else will not work right
 
#include <iostream> using namespace std; int num1, num2, result, function, add, subtract, multiply, divide; int main() { cout << "Please ente...
[2 replies] Last: Thank you for the help. It works really well now! (by Orrin)
September 2016 Pages: 1... 1516171819
  Archived months: [aug2016] [oct2016]

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