General C++ Programming - January 2018 (Page 4)

Beginner C++ program question
 
This is my first time with C++ and only a week in and my teacher goes way to fast!! and has already assigned us homework, please help me. Thank you! I need to...
[1 reply] : well, a design isn't code. Try extending the text above a little to e... (by jonnin)
Turning on lights
 
Hello, I am about to embark on a project where I use code to turn on a light switch. So far what I have gathered is that I need to create a class that send out ...
[1 reply] : first is to figure out exactly how you will flip the switch... you ne... (by jonnin)
by Osmium
Strange error with gsl_matrix_complex type
 
Dear community, when using the following code: #include <gsl/gsl_linalg.h> #include <iostream> #include <gsl/gsl_complex.h> using namespace std; ...
[2 replies] Last: Ok, thanks for the answer, I'll check this. (by Osmium)
Checking if user input is a number or character
 
Hey guys, Does anyone know how to write a programme that checks if the users input is a number or is alphabet, im new to c++ and am trying to make a program...
[5 replies] Last: > You need to clear the rest of the line whether the input is good or ... (by JLBorges)
Which one is better?
 
Hello guys, I am beginning directX 11 game developement and I think I need a book so i asked many people and they always refer me to "Practical rendering and co...
[no replies]
crashing allocator for std.:unordered_map
 
When trying to invoke a custom templated PoolAllocator<T> for std::unordered_map<T>, I get segfaults when accessing the map with the operator . Using this alloc...
[5 replies] Last: I have a rebind, which should explain why std::map works and using the... (by dailydols)
Why cannot i use (==) or (>=) in Xcode?
 
I do not know why i cannot use == or >= on Xcode on mac to the this simple code. #include <iostream> #include <string> using namespace std; int main(){ ...
[2 replies] Last: Thank you very much keskiverto. I fixed the error, with your clarifica... (by Chilli Mustard)
Does money_get<> work correctly?
 
On coliru, I have tested the money_get <> facet for USD and EUR. It works correctly (as far as my test data was concerned) for USD, for not for EUR. The prog...
[6 replies] Last: As mentioned on cppreference page for std::money_get::get, std::showba... (by sm2345110)
How to iterate two vectors at the same time in For LOOP
 
Hi all, I have a issue where two different vectors has to iterate at same time. Basically to say i have ZIP_Iteration problem with two vectors. I tried to ...
[3 replies] Last: What you want is an up-and-coming feature of C++17 compliance that eve... (by Duthomhas)
by WiWo
Late binding in a list
 
I'm using a list to store objects of different classes, which have a common base class. Moreover when I access directly an element of the list, I need to use la...
[2 replies] Last: Thanks a lot. I thought this would have not worked because in my proj... (by WiWo)
Google Mock and pointers in the test
 
Hi Could someone explain me what is going on in this test: SimpleTest.h #include "gmock/gmock.h" class SimpleTest : public ::testing::Test { protected: ...
[3 replies] Last: Could you explain what do you mean by "leak". When an invocation of ... (by cire)
C++ Input verification
 
Hey guys, Does anyone know how to write a programme that checks if the user's input is a number or is alphabet, I'm new to c++ and am trying to make a progr...
[5 replies] Last: #include <iostream> #include <string> #include <cctype> using namespa... (by lastchance)
BITCOIN C++
 
hey guys, I was wondering if anyone knew how to write a simple programme on bitcoin and how it works, such as hashes, Blockchain, transactions, private keys a...
[no replies]
Removing White Spaces
 
Guys I'm doing an Scanner for a compiler so i'm testing the basic read, deleting and write in a separate file. This piece of code is to test the erasing of a w...
[5 replies] Last: > I'm doing an Scanner for a compiler We can't just remove (or ignore... (by JLBorges)
BITCOIN - CRYPTOCURRENCY
 
Hello guys, I am really interested in bitcoin and cryptocurrency and I just found out that bitcoin was written in C++, does anyone know how to write a simple...
[no replies]
Limited Login Attempts
 
Hello c++ programmers, Im a beginner in c++ and im trying to make a programm that will close after you get the password and or username wrong 3 or more times, d...
[4 replies] Last: @Ganado - Really good feedback, thanks sir👍 (by jono ava)
C++ User input verificartion
 
Hello C++ programmers, I am finding it difficult to write a programme in C++ that automatically knows whether you have inputted 1 or more numbers. I want the...
[9 replies] Last: Thanks for that, really helpful👍 (by jono ava)
storing a json object in a vector
 
Hi guys, I have a question. I am working with a json file for the first time, and I am trying to store the contents of it into a vector pass it to a sorting fu...
[1 reply] : One problem is this: std::vector<int>data ; // This is not filled std... (by coder777)
Fields in the test class are not visible. Google Test, CLion
 
I am writing unit test in CLion with Google Test Test.h #include <gtest/gtest.h> class CycleTest : public ::testing::Test { protected: void SetUp() { ...
[1 reply] : To use a test fixture, replace the macro TEST with TEST_F. The interf... (by mbozzi)
Problem using STL library (-map)
 
Please can you help me with this problem that uses the STL Library(-map): Create a string of n people, name and age. Calculate the average age of all people in...
[3 replies] Last: If you have the input data is a text line consisting of name and age t... (by AlexCantor)
January 2018 Pages: 123456... 10
  Archived months: [dec2017] [feb2018]

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