General C++ Programming - December 2015

unordered_map not working in class
 
class State { public: State(); protected: private: std::unordered_map<std::string,std::unique_ptr<int>> objects; }; Th...
[7 replies] Last: Actually, the int type is just a placeholder. It was originally of typ... (by Gadersd)
by Rafay3
C++ Game
 
I Try to make a game..and you have to Create Unique name Everytime or game over but It crash when I start the game #include <iostream> using namespace std; st...
[3 replies] Last: Use a std:;vector instead. vector will allow you to store an unlimite... (by AbstractionAnon)
how can i convert a string result to LPVOID?
 
imagine that my string value is a variable adress. can i convert that value to LPVOID?(i mean the value and not the string adress)
[4 replies] Last: I missed that your string value was a variable address. Any techniq... (by AbstractionAnon)
unsigned char to string
 
I'm looking at using openSSL. They use unsigned char in the functions. I'm trying out some conversions with the following: < #include <iostream> #include <stdi...
[1 reply] : You are experiencing sign extension on the str hex: output. Because t... (by koothkeeper)
Please help: Error: Expected Primary-Expression
 
Hello guys. I am having this strange error while making a game in SDl2/codeblocks. Error is related to c++ programming and not to SDL library or anything. H...
[4 replies] Last: Thank you. (by nura1717)
how make a multithread correctly synchronizated?
 
how can i make a multithread, correctly, synchronition? for make a multtihread function i must do use: pthread_create() using mutex i can synchronizate(say...
[4 replies] Last: Delaying the thread for a specific time doesn't guarantee to make your... (by Shadowwolf)
Some questions about C++ programming.
 
Hi I'm pretty new to C++ and obviously I have some questions about some problems I'm having. 1) Some people say that using "using namespace std" is not pro...
[2 replies] Last: 1. You can use google. https://www.google.se/?gfe_rd=cr&ei=4wiFVr68NK... (by TarikNeaj)
appcrash fault
 
it gives appcrash problem after command promt window when i run it. i use dev c++ 4.9.9.2 #include <iostream> #include<string> using namespace std...
[5 replies] Last: thank u "Why is deneme() calling deneme()?" i understand... (by ggurhann)
find the last word in a string
 
I assumed that there would be functions to cover a lot of these string operations I've been doing lately but... Here is my newest problem. I am writing a fun...
[5 replies] Last: Same logic as above (reverse the string, read first token from the rev... (by JLBorges)
using == with an assignment expression
 
What is this saying exactly? int result = (num1 % num2) == 0 I don't understand how the == 0 works. If the statement doesn't make sense here is where I ...
[2 replies] Last: Thank you very much! (by NuklearKrisis)
creating strings with specific conditions.
 
I'm trying to create a Book class with a string member representing the ISBN. The ISBN must follow the format n-n-n-x where each n is an integer and x is a char...
[1 reply] : Use the standard regular expressions library. http://en.cppreference.c... (by JLBorges)
Using 2D vectors
 
I want to construct two 2D vectors to which I can add vectors to in the future. However, even the beginning attempt to push_back a 1D vector as the first row of...
[4 replies] Last: If you want to modify an existing element, use the array syntax or... (by Chervil)
Crash when assigning values, but only meaningful ones
 
- I doubt anyone else will have this particular problem, but have a discussion topic. This problem has been fixed and was related to the MASSIVELY quirky way t...
[4 replies] Last: I haven't previously used valgrind, but I will look into it to see if ... (by Some Moron)
by ahmmkh
a problem set by c++ and c
 
Write a program without any semicolons and it takes an input X from the user and then print "Hello" X times each "Hello" in a single line
[7 replies] Last: Actually most of them are working guys , but i actually managed to und... (by ahmmkh)
Need PDFs!
 
I've read tutorial about C and C++ in PDF, i downloaded the C++ PDF From this site, Now can you please give me some links to download C++ Intermediate Tutorials...
[2 replies] Last: Groningen C++ Annotations (pdf and other formats): https://github.com/... (by JLBorges)
by Ketan
System command with Two arguments
 
Hello, Upto best of my knowledge, I know that system command takes string as input. This string can be of any thing, which works fine into command prompt. For ...
[3 replies] Last: > I would like to know whether system command does behave same as comm... (by JLBorges)
Why this behavior?
 
Hey guys! I have a struct template nodeType and a class template nodeType as shown below and I have shown the simple definition of the member function node...
[6 replies] Last: > when returning just a type, a reference to a type, or a const refere... (by JLBorges)
something confused
 
#include <iostream> template <class T1, class T2> void fun(T1&&, T2&&) { std::cout << typeid(T1).name() << " " << typeid(T2).name() << std::endl; } class...
[2 replies] Last: Thanks! BR! (by Wu zhen hai)
thread construction function does not support function overloading
 
//thread construction function does not support function overloading //it is so unfriendly #include <thread> #include <iostream> class A { public: void ...
[2 replies] Last: thanks! BR! (by Wu zhen hai)
string search
 
How can I compare two strings to seen if more than one word matches? Eg. str1= ("Computer Architecture) Str2= (computer systems and Architecture etc) Sinc...
[5 replies] Last: thanks, with some modifications it works exactly for me (by andrewllewop)
December 2015 Pages: 123... 22
  Archived months: [nov2015] [jan2016]

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