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

what these lines implies taken from design patterns book?
 
There are two benefits to manipulating objects solely in terms of the interface defined by abstract classes: 1. Clients remain unaware of the specific types o...
[3 replies] Last: Thanks . I got it. (by gurpartap)
Error: cannot convert 'double(*)(double,double)' to 'double'
 
Hi, I'm writing this program and it says "Error: cannot convert 'double(*)(double,double)' to 'double' for argument '3' to 'double futureSal (int, double, doubl...
[2 replies] Last: Thanks, I got it. (by thaooherb)
by Handge
C++ getting error when outputing text into file with ifstream
 
So I am writing some stuff to a file and I'm getting this error when: int x = 10; ifstream data ("data.txt", ifstream::out); data << x << "\n"; The error ...
[1 reply] : Why are you trying to output with an ifstream? Either use an fstream w... (by tpb)
Asking questions about functions
 
Hello, i decided to begin learn basics of functions in C++ and i have a questions. I have pretty smooth knowing of what lying under functions in C++. But i know...
[6 replies] Last: 4) yes and no. Compile does give an object file, but it may also li... (by jonnin)
Expression: string subscript out of range
 
I'm having an issue with a function causing an error when running. The function is: wstring Tools::FormatPlainText(wstring Text) { wstring result = L""; wst...
[4 replies] Last: Wow was I using that incorrectly then!!! Thank you! (by VirtualizeThis)
using empty = nullptr
 
using Empty = nullptr; results in error expected a type specifier . After some research it turns out nullptr is of type std::nullptr_t but that doesn't wor...
[2 replies] Last: It should probably be a constant. constexpr std::nullptr_t Empty ... (by Peter87)
How to build char?
 
How can I make my char like this? const double version_num_ = 1.0; const char *version_ = "v" + version_num_; I am getting an error which says "express...
[2 replies] Last: But my const char is a class member. Is there another way? Thanks. *NE... (by Putarda)
How to save to file a struct containing strings
 
Good morning everyone I'm trying to save a vector of this struct : struct element { std::string filename; std::string hash; bool isLocalized; }; to a fi...
[1 reply] : Something along these lines, perhaps: struct manifest_element { ... (by JLBorges)
New line question (preferred) and ASCII symbols
 
Hey, I need my ASCII table values to start from 0 and go to 7, then start from 8 and go to 15, then start from 16 and go to 23, then 24 to 31 and so on for part...
[15 replies] Last: #include <iostream> #include <iomanip> #include <cctype> /... (by lastchance)
C++
 
warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default] string position= "123456789"; Hi all i ha...
[1 reply] : Compile with the options -std=c++11 and -pedantic-errors For ... (by JLBorges)
by Handge
C++ Program not inserting text to file
 
I have a program that is supposed to insert text to a text file, but it is not inserting the desired text Heres the code #include <iostream> #include <str...
[2 replies] Last: Thanks, Really helped (by Handge)
by Handge
C++ how to make game save file
 
I'm currently making a RPG game and was wondering how would I make the game to save everything into a file then load it and set all the variables Health 100...
[1 reply] : http://www.cplusplus.com/doc/tutorial/files/ (by Moschops)
im still new in programming ,i really hope you guys could help me to check mind ,because its always diplays 0
 
#include<iostream> using namespace std; int main() { float num1,num2,total,average; cout<<"Enter two numbers:"; cin>>num1>>num2; total:num1+n...
[5 replies] Last: you are not understanding what he said. For some weird reason he put ... (by jonnin)
How to find week number?
 
Hello, What is the fastest way to find the week number (ISO-8601 for weeks starting on Monday) based on a tm struct? Currently I do: struct tm *dt = .....
[5 replies] Last: Thanks a lot. Very usefull code :) (by coredumped)
PPP2 Chapter 16 Exercise 6
 
I posted about this in the PPP Google Group as well and got some good things, but I'd like more input and it doesn't seem I'm getting a reply there anytime soon...
[no replies]
Tic Tae Toe
 
Write a class called Board that represents a tic-tac-toe board. It should have a 3x3 array as a data member, which will store the locations of the players' mov...
[2 replies] Last: https://www.assignmentexpert.com/blog/do-my-c-homework/ http://www.tut... (by Thomas1965)
how to do swapping??? (1,2)
 
plz tell me how to do swapping i want to swap the value of b into a and value of a into b without the addition of variable ... plz help me fast i have to run i...
[21 replies] Last: got it... thanks (by champ195)
qsort() syntax not clear
 
Please consider the invocation of the qsort() function in the following example: #include <cstdlib> /// qsort() #include <cstring> /// strcmp()...
[3 replies] Last: Forgot to mention it earlier; in theory, this engenders undefined beha... (by JLBorges)
program of swapping
 
can any one plz give me a program to do swapping???
[7 replies] Last: thankss my friends i have done by this program. (by champ195)
by quiret
std::map with non-copyable key type?
 
#include <map> struct movable_key_type { int key_thing; inline movable_key_type( void ) {} inline movable_key_type( movable_key_type&& right ) { ...
[1 reply] : > The above code compiles fine under Visual Studio 2017 > but it fail... (by JLBorges)
August 2017 Pages: 1... 34567... 9
  Archived months: [jul2017] [sep2017]

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