General C++ Programming - September 2015 (Page 17)

Prime algorithm for SPOJ
 
Hey guys I'm doing this problem on SPOJ and basically when provided a beginning and end integer limit m and n respectively, it outputs all the prime in that ran...
[2 replies] Last: Ahhh I see I had it all wrong :S I thought I was on to something... I'... (by BarelyOtaku)
C++ Instance Methods Cache Friendly?
 
I've been reading up on design patterns and I had a question about the cache friendliness of methods. Here is some sample code: class a { public: int n...
[5 replies] Last: Ah, that makes sense. I was looking at the cache friendly design patte... (by horrificmonster)
Read key input in real-time
 
I am working on a game in Ogre3D, and have OIS as my input library. I also have 2D graphics to display text glyphs and sprites for the GUI. Right now I am at a ...
[4 replies] Last: I see, alright. As for attempting a solution on my end, I have found a... (by molma100)
Unicode wchar_t -> char
 
I have to deal with std::wstring encoded in unicode. I need to be able to convert is to std::string (wchar_t -> char). So far, I've tried std::wstring_conve...
[1 reply] : Works for me: #include <iostream> #include <string> #include <codecv... (by helios)
Multiple .cpp and .h files with constants
 
Hello, How can I define a constant which can be accessed to any .h or . cpp file in the project? My efforts are: //MAIN.CPP #include "FILE1.h" #include "FILE...
[15 replies] Last: [quote=Duoas]That doesn't undo the bad advice given before constexpr w... (by Peter87)
How can I recycle pointers to use for different object's parameters upon creation?
 
So let's say I have a few class objects, and this class owns a pointer to a Base component. I use pointers to take advantage of polymorphism. For simplicity, le...
[10 replies] Last: that means you get another behavior but the location in memory for Co... (by MiiNiPaa)
all (3 digits permutations) of array with n elements
 
thank you it is finished
[3 replies] Last: the thing u said me did just the permutations of first 3 elements it ... (by MiiNiPaa)
by homing
container vs built-in array
 
Hey, As far as i know it's more preferred to use containers than the built-in arrays. I've always followed the advice but how about performance between these b...
[6 replies] Last: It depends on your design . With static/automatic arrays std::array ... (by MiiNiPaa)
Warning fseek in binary file
 
#include<conio.h> #include<iostream> #include<fstream> #include<stdlib.h> #include "antheader.h"//this is my own header to use wiht gotoxy #include<string.h> u...
[2 replies] Last: Oh thank you alot it's work. (by rathpanha)
General Debug Error (Bit-Version etc.)
 
Dear Community, at first excurse my simple and may wrong english. I want to know everybody can help me for my problem. Few days ago I installed visual st...
[1 reply] : https://support.microsoft.com/en-us/kb/2757355 (by MiiNiPaa)
Can somebody help me explain this function?
 
Hello! I need some help to understand this function. Why a two dimension vector is needed here? Thank you in advance! void output_results(const vector<st...
[4 replies] Last: No, I forgot to do that. That's the problem. Thank you for reminding m... (by radar114)
Creating a Triangle From array
 
thank you its finished
[6 replies] Last: Answering here instead of private message: firs of all, throw out your... (by MiiNiPaa)
CodeBlocks SDL: "ld.exe cannot find -lSDLmain"
 
I had installed SDL with this tutorial http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/codeblocks/index.php and as far as I know, everything works e...
[7 replies] Last: I'm an idiot. I just realized that the global compiler setting were s... (by HOWDOIAIM)
First Time C++ Coder: Need Help With One Little Part (loop)
 
For my project, I need to make a program that would ask for a dollar amount for bottles that cost $2 and for every 5 bottles, the user would receive a free bott...
[2 replies] Last: Thank you but I solved it! (by mk92595)
Random arrays compiler issue
 
The program I created is suppose to work as follows. Program takes an array with predetermined values on it (in this case it takes the values of a deck of ca...
[1 reply] : You should only call srand once in your program. At the beginning of m... (by Peter87)
by Micard
SDL 1.2 to SDL 2.0 - rotozoomsurface
 
Hi! So I'm rewriting this piece of code to SDL 2.0. I think I'm doing okay except for the part with rotozoomsurface. Since I've got rid of all the surfaces, how...
[1 reply] : If you want to use rotozoom you should load the image as a surface tha... (by Peter87)
by Roneel
This program gets ID marks from a txt file and determines grade. how to pass the void print_students_records function.
 
#include <iostream> #include <fstream> #include <cstdlib> #include <string> using namespace std; const int MAX_SIZE = 10; class student{ publi...
[1 reply] : void print_students_records(string s ,int size); student s ; print_s... (by ne555)
sum of numbers in one line
 
done ,
[1 reply] : http://www.cplusplus.com/articles/oGLN8vqX/ (by Radar)
Qt Cannot open file 'shell32.lib'
 
Hey guys, I'm trying to compile a simple qt application and I get the follow error message: cannot open file 'shell32.lib'. Any ideas on how to fix this? I've b...
[no replies]
September 2015 Pages: 1... 1516171819... 21
  Archived months: [aug2015] [oct2015]

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