General C++ Programming - January 2016 (Page 16)

by Xriuk
Problem with passing parameter to parent class in constructor
 
I have a class (inheritance is virtual cause I use multiple inheritance ahead): class XGE_Texture : virtual public XGE_Object Its constructor (rect() prints...
[8 replies] Last: The constructor is this one: XGE_Object::XGE_Object(int x, int y, int... (by Xriuk)
Decode id3v2-3.0 tags
 
The following code is simple, compact and can be easily ported into small critical apps. I wonder if there are such simple algorithms for other versions of MP3...
[1 reply] : I wonder if there are such simple algorithms for other versions of MP... (by kbw)
remedial ptr question
 
Why am I able to assign the value of 7 here: #include<iostream> using namespace std; int main() { int name = 12; int * n_ptr = &name; *n_ptr = 7; cout<<...
[4 replies] Last: ... thank you (by technologist)
by a10e29
Proof reading some logic
 
Greetings. Having some trouble with a camera object when determining when to stop. Would you please proof read this snippet for any logical errors? SDL_GetM...
[2 replies] Last: SDL_GetMouseState(&mosPos , &mosPos ); motion = (mosPos >= 750);... (by a10e29)
i keep getting errors i dont understand
 
My code is the following: #include <iostream> #include <string> { string password; string correctpassword="Billy"; cout<<"Please enter password."<...
[10 replies] Last: i have now figured my problem, thanks for helping. (by YvngSavage)
array/main.cpp question
 
The following code works in its parent program. The array only works if it is initialized in main.cpp. While this is not a problem with one, initializing more i...
[17 replies] Last: Cire (et al) I have eliminated 2 of the obvious bugs in your post ment... (by technologist)
Append to Char[]??
 
So I have the following code To Prompt for filename: cout << "Please enter the filename for the report: "; cin >> filename; ConvertToUpper(filename); Then...
[3 replies] Last: Thank you guys very much~ (by Xenroid)
Problem with HTTP GET Request
 
Hi guys, i have a problem with HTTP GET Request. Im connected to socket so i want to get a data from 1 site, so here is how looks like my "query": send(Socket,...
[1 reply] : The result is a 404, meaning the page could not be found on the server... (by Shadowwolf)
access memory violation
 
Hello Everyone so i am trying to copy the contents of a list into a char array but i get an access memory violation error when using memcpy, my code i use is be...
[4 replies] Last: Fixing all the errors shortens that code considerably: std::vec... (by Cubbi)
by kalki
How to use map with hex values??
 
#include <iostream> int count=0; using namespace std; int getBit(int n, int k) { unsigned x=0; x=(n & (1<<k)) != 0; cout<<x; cout<<endl; if(x==0) { ...
[1 reply] : Hi, I was playing around (just for fun) with your question and come up... (by codekiddy)
by GTHell
C++ Primer 5th? Should I continues the book?
 
Hi there This is the same question for high school student that keep asking their teacher why they learning math and when will they use it. I'm in about 100...
[2 replies] Last: I think I memorize a lot and the back up reason is because they try to... (by GTHell)
Code problem on Arduino
 
Hello everybody . I`m building burglar alarm with sms alert with ir throughbeam sensors I have a problem with the code gsm modem sending sms even when...
[2 replies] Last: That may be because when the beam is broken the digital output will be... (by Stalker)
by siery
Fibonacci number calculation method problem
 
Hello. My idea was to improve the Fibonacci number calculation method by adding a memo. I represent memo as a vector. Every time algorithm are working, it shoul...
[9 replies] Last: Try this change and tell me what happens for (unsigned int i = f_n -... (by Stalker)
std::unordered_multimap::bucket_size=0
 
Hi friends. I want to ask if somebody can help me in this situation : I do following code : <code> unordered_multimap<SetPartition,int> sparts; //fill this...
[3 replies] Last: Hi, i want to tell you that i already found my error. Hash function of... (by danjiun)
by Gyiove
double * float, will there data loss?
 
Hello everyone! I have double p for example. p has to be really accurate. Then i have float s what will usually be something like 0.0001 - 2.0 Now the...
[8 replies] Last: Hi, One other thing, float does not have the same precision as d... (by TheIdeasMan)
What is wrong with my temp. converter program?
 
Hi, I'm new to C++ and still in beginners learning mode, could anyone please tell me what's wrong with the program I made for the temp. conversions?? It doesn't...
[2 replies] Last: Wow, you're a genius sir .. Many thanks ..!! (by Saad1237)
Problem statement
 
Princess Rupsa saw one of her friends playing a special game. The game goes as follows: 1.N+1 numbers occur sequentially (one at a time) from A0 to AN. 2.You ...
[1 reply] : This is a problem in an active contest. Please remove your code and q... (by cire)
by kalki
Bit operation and look-up table
 
Is there any utility or library provides a simple function to convert a hex to binary and then depending on bit set assigning decimal value ? This will conver...
[3 replies] Last: #include <iostream> #include <limits> #include <bitset> // int count=... (by JLBorges)
by Xriuk
Reinitialize object without invalidating pointers
 
I have: MyClass* A = new MyClass(1); MyClass* B = A; /* doing things with A */ // Here I need to reinitialize A (eg. new MyClass(2)) and update B automatically...
[6 replies] Last: If you want B to basically be just another name for A, which is what i... (by Moschops)
Functor with default parameters.
 
Hi guys, Short version: Is there a way to pass a functor/bind a function with one or more of the parameters fixed? e.g. Function takes a functor of a func...
[13 replies] Last: I will be rereading that post once I've absorbed a few more reference ... (by Gaminic)
January 2016 Pages: 1... 1415161718
  Archived months: [dec2015] [feb2016]

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