General C++ Programming - August 2017 (Page 6)

How to initialize a static std::map in a cpp file?
 
Hello++ I'm trying to initialize a static std::map in a cpp file. I looked at https://stackoverflow.com/questions/138600/initializing-a-static-stdmapint-int-...
[3 replies] Last: A variable can only be declared as static (in the header). You need to... (by coder777)
Help with name of sorting algorithm
 
Hi all, A question has arisen on an old exam paper used for revision which asks about a type of sorting that I cannot find the name of anywhere. Hopefully so...
[4 replies] Last: I like the name 'winding', but the sort you are looking at is a varian... (by Duthomhas)
C++ 17 Parallel Sum
 
Following web site has small program to parallel sum elements of Vector: < http://en.cppreference.com/w/cpp/experimental/reduce > < #include <iostrea...
[10 replies] Last: > Is there a freely downloadable latest compiler such as g++ with all ... (by JLBorges)
String Code, Shipping Charge based on Region Code
 
Write an introductory C++ program that displays the appropriate shipping charge based on the region code entered by the user. To be valid, the region code must ...
[6 replies] Last: I put the stdafx.h first like you suggested and it fixed it all. That ... (by Ludicrousenigma)
String Code that shows Reverse Order of what is Input
 
Write a program that accepts a strong of character from the user. The program should display the characters in reverse order. In other words, if the user enters...
[6 replies] Last: Thanks so much! (by Ludicrousenigma)
Read Entire Line from File and Add to String
 
So this is an easy one I'm sure. I've Googled around and tried some thing but haven't got anywhere so I'm turning to the experts. I have a file. The file has a...
[4 replies] Last: Figured it out. Thank you everyone for the responses. void Tools::Di... (by VirtualizeThis)
String Code using a sentinel value
 
I have to write a program that allows me to enter three separate strings: a city name, a state name, ad a Zip code. the program should use string concatenation ...
[2 replies] Last: Yes! Runs perfect now. Thank you so much! (by Ludicrousenigma)
by Handge
How to make text health bar
 
How would you go about to making a text health text bar? I want it the contents inside the {} to depend on health, and have the {} not move at all {:::::::::::...
[1 reply] : About color output: https://www.codeproject.com/Articles/24896/JLib-A-... (by Thomas1965)
Error C3867 assign': non-standard syntax; use '&' to create a pointer to member
 
First post, not a big user of forums so please excuse any issues. I'm having an issue with one of my functions in a C++ program. The complete error is: C3867 ...
[4 replies] Last: Thanks JL. That's perfect! (by VirtualizeThis)
Won't let me divide/what's wrong?
 
My code won't let me apply the division 'x/365' there are other mistakes... #include<iostream> #include<cmath> #include<math.h> #define PI 3.141592653589...
[3 replies] Last: Please note some of the maths errors too: hyperbolic cosine (cosh) is ... (by lastchance)
Preprocessor or lexical analysis
 
The following transformations takes place in Lexical Analysis or Preprocessor makes it? 1) Omitting the comments 2) Backline/New Line sequences 3) Replaceme...
[1 reply] : Prerocessor. It probably took you more time to ask here on the forum ... (by Duthomhas)
Circular include. Expected name-class before '{' token
 
This is my code: main.cpp #include "game.h" #include "human.h" #include "AI.h" #include "ref.h" #include <iostream> #include <cstdlib> #include <st...
[1 reply] : Basically a duplicate topic: http://www.cplusplus.com/forum/general/22... (by jlb)
Anyone please help me to correct the "declaration syntax error."
 
#include<stdio.h> voidmain { int u; float b=100.00; cout<<"/n Enter units(u)"; cin>>u; if(u>0&&u<=100) b=b+u*1; if(u>100&&u<=200) b=b+100*1+(u-100)*...
[1 reply] : The first few lines: #include<stdio.h> voidmain { should look som... (by Chervil)
array char[] error :(
 
Hi guys, i have a problems understanding about array char but it was required in my code to have a array char named outcome with size 15. class Check { cha...
[1 reply] : The code above doesn't compile, there are numerous errors - missing cl... (by Chervil)
Circular include. Expected name-class before '{' token
 
Hi, I'm new to programming. I'm trying to make a RPS game but I'm having trouble with the circular include. I will post all of my code here. Thank you! main.cp...
[2 replies] Last: Please post the complete error messages, all of them, exactly as they ... (by jlb)
Output deck of cards not aligned, why?
 
Trying to display deck of cards, but they aren't side by side; rather they have gaps in the next line down. #include <iostream> #include <iomanip> #include <...
[2 replies] Last: Another way using cstring funcionality to copy and join C-style string... (by closed account 48T7M4Gy)
Invalid conversion from ...<char> to int
 
Hi, I am imitating a queue using a linked list. I created a struct node, then I created a struct called imiQueue with some member functions and the imiQueue fun...
[1 reply] : The expression A ? B : C is an expression, not an statement like if(A... (by Cubbi)
by hav206
is there another faster way to delete a string
 
// // main.cpp // characterRemover // // Created by Van Ha on 6/7/16. // Copyright © 2016 Van Ha. All rights reserved. // #include <iostream> void remo...
[7 replies] Last: > is making the bool table static and clearing faster than recreating ... (by JLBorges)
by DNS323
Creating a csv file in a particular folder
 
Hello all, I am new to a c++ programing and currently working on my college projct. I have to create a csv file which take data from the CAN connected to the...
[9 replies] Last: @Thomas1965 Hey, Thanks. It is working well. Thank you very much. I ha... (by DNS323)
How to access the protected variables?
 
I cannot access the protected variables even within a derived class. #include <iostream> using namespace std; class Weapon { protected: int ...
[3 replies] Last: Hi, There probably isn't much point in making the variables protected... (by TheIdeasMan)
August 2017 Pages: 1... 456789
  Archived months: [jul2017] [sep2017]

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