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

A templatized regex match function
 
I am trying to code a parameterized regex match() function. The idea is to create a function which can accept any regex as a template parameter and return the...
[2 replies] Last: You probably mean: if (regex_match(s, matches, USZipCode )) ... (by kbw)
Help with this C++ question
 
1. Write a C++ function prototyped as unsigned int countLargerThan( int* arrayValuesToCheck, unsigned int sizeToCheck, int minimumValue ); When the first fo...
[5 replies] Last: I got it! Thanks for the clarification. I did something similar #in... (by closed account 1hqj1hU5)
by EgorV
ifstream :: getline
 
#include <iostream> #include <fstream> using namespace std; int main() { ifstream test; test.open("test",ios::trunc); char temp_str ; test.getline(t...
[9 replies] Last: wow, it was so easy thx (by EgorV)
How to pass a vector from an intermediate index to a function and use it with zero based indexing in that function.
 
Hi guys :), In case of arrays, we can pass them from an intermediate index to a function and use zero based indexing in the passed function. eg : void f(in...
[2 replies] Last: work with iterators void f(vector<int>::iterator a){ std::cout << ... (by ne555)
Using variable defined in if statement
 
class Tournament { public: Tournament(); int startGame(string Player); private: }; Tournament::Tournament() { } int Tournam...
[5 replies] Last: why do I have to use const, instead of just string? You don't have t... (by dhayden)
Adding together ASCII(h) representation of bytes in an array<Byte>
 
I am trying to send a message consisting of a few byte using visual studios c++. The device requires serial communication and I am using array<Byte>: https://st...
[1 reply] : 'ASCII' is text representation. 'hex' notation is text representation.... (by Duthomhas)
++char
 
I'm trying to understand how this piece of code works. void reverse(char *str){ char * end = str; char tmp; if(str) { while(*end)...
[2 replies] Last: so the parameter (str < end) means that the while loop runs while poin... (by clarkkent)
Looking for a more elegant solution to this meta-programming bit
 
Hi, I have what I want in terms of functionality (I can pass a string or wstring and the function template quotes the string or wstring with the appropriate ...
[8 replies] Last: Thank you guys! I was looking for the solution provided by Cubbi! Re... (by JUAN DENT)
When one class has object of another class as data member and vise-versa.
 
Suppose I have class A : //A.h class A { protected: std::vector<B> bList; public: //some stuff with bList }; [ You see that it requires the def...
[1 reply] : forward declare in A.h class B; //declaration class A{ //definition }... (by ne555)
Vectors vs Dynamic arrays.
 
I find it possible to initialise arrays dynamically in C++. By this i mean : int n; int ar ; works fine. So what is the difference between thi...
[1 reply] : Actually, what you wrote is illegal in C++! In C++, you cannot make a ... (by NoXzema)
OpenGL
 
I was looking forward to learning OpenGL in C++, what are the best tuorials?
[2 replies] Last: Thanks, tough i was wondering about a video, thanks anyways. (by masecla33)
scope issue in reading source code from files
 
What am I getting the following error for the below code? It does have OpenGL calls i it but I believe it is still mostly a c++ problem -- why is it (textfilere...
[10 replies] Last: Where is the .exe file? The file must be in the same directory as the... (by jlb)
by Yoan
Maze generation and unicode characters
 
I need help making my maze look better.I want to use unicode characters but my program crashes. #include <iostream> #include <ctime> #include <cstring> using s...
[3 replies] Last: For unicode characters, you need to use wchar_t and std::wcout . Al... (by Golden Lizard)
Octa-core CPU loaded with Mi Mix 2
 
Is this some kind of new advertising technique?
[1 reply] : Don't reply to spam. Just report it. (by helios)
The code goes fine for one case, goes mad in the second
 
So, i made this program that uses a few lines and spaces to create a sort-of bounce like line on the console. Tough it only uses / and \ so i added the option f...
[1 reply] : nvm. I realised i had to add <<endl; after couting cara. Sorry for was... (by masecla33)
DATABASE MAKER
 
Hello guys!! I need some expert help! I had tried to program a database maker. What it does is that it allows the user to at first make a template file which...
[1 reply] : Can you please edit it and add in a code? It would be very helpful (by masecla33)
by hav206
string tokenize to buffer
 
write a function stringtobuffer that will incrementally tokenize a string. This is my code. However it is wrong. Anybody has any idea? bool StrTokenizeToBuffe...
[3 replies] Last: Thank you Duthomhas (by hav206)
How to return pointer of a member and protect it.
 
How do I return a pointer from a class and protect it from changing? I tried with const Vector *getPosition() const; but when I try to use .getX(), an error co...
[8 replies] Last: show your code, 'it's not working' is not enough information (by gunnerfunner)
by haile
support for c++ code
 
1. how to write a c++ client- server architecture of socket programming an iterative TCP server (called serv1) and the corresponding client (called clie...
[1 reply] : Sorry we are not a code writing service here. A quick Google search sh... (by Thomas1965)
August 2017 Pages: 123456... 9
  Archived months: [jul2017] [sep2017]

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