General C++ Programming - May 2014 (Page 5)

by Daleth
Overloading versus template specialization to determine behaviour
 
When using templates to determine the behaviour of a function or class (e.g. if you test type traits), is there any particular disadvantages and/or advantages t...
[1 reply] : http://www.gotw.ca/publications/mill17.htm (by cire)
vsprintf-like function for strings?
 
I am trying to create a function like so: void out(std::string format, ...) { va_list args; va_start(args, format); std::string formatted_string = v_for...
[17 replies] Last: Adding to what JLBorges says about macro's and 'printf', defining 'pri... (by xuinkrbin)
programing in ubuntu
 
hello friends .. how to use graphics in ubuntu(terminal). or how to use Linux command in c++ program.
[14 replies] Last: Understand that all the answers have described how to "use graphics" u... (by Lachlan Easton)
Get past cout.
 
So.. I've watched a bunch of tutorials on C++. Most of them teach me the basics with printing things out in the console. Arrays, pointers.. etc.. I've learned a...
[2 replies] Last: I'd like to learn software developing in general. Calculators, browser... (by robkar32)
Baffling issues with object variables going to NaN
 
Hello, So I am trying to develop a sort of 2d spacesim engine for creating games in C++. The project uses SFML for graphics, and I am currently trying to com...
[2 replies] Last: Thats part of the problem. The vessel objects are polymorphic, with an... (by BruceJohnJennerLawso)
by nines
Get the wanted result with given numbers
 
Hi all, I'm looking all day for algorithm that sums all given numbers to match the result. For example : user input : (6 numbers) 2, 5, 3, 5, 20, 100. And wa...
[1 reply] : This seems like a generalization of the game "24", which in turn seems... (by long double main)
Attraction between objects
 
How would I make it so one thing is attracted to another? Not being attracted from far away, but very attracted up close. I can't really find anything on google...
[5 replies] Last: Oh I see what you're saying now, I misunderstood. You could do someth... (by Pindrought)
Auto Run
 
Some of you may know how auto run has been disabled in Windows 7 and so I was wondering if it is possible to make a c++ program that will enable auto run or som...
[2 replies] Last: nvm I figured out how to do it using a batch file, if anyone else is i... (by DeathAngle)
deciphering an unknown shifted caesar cipher text file
 
Hello every one, I have spent the past week working on this assignment and i'm hoping to get some help on what I need to do to correct my sift and get it to pr...
[5 replies] Last: If the code that reads the input file the first time works then use it... (by dhayden)
VGA display memory mapping?
 
How is the memory written to a frame of memory (0xA0000-BFFFF) mapped onto display memory (0-256k)? I've implemented simple mapping using the write and read mod...
[no replies]
rand() gives the same number everytime
 
hello, I have a problem with the: rand(); function. It keeps generating the same number over and over again. I use it like this: switch (mode) { ...
[6 replies] Last: thanx (by p33n kenan)
Getting "Error: incomplete type is not allowed"...
 
...when declare and assign an instance of a user-defined struct in a function. And the struct ( theStruct ) is not declared in the same header file as the funct...
[6 replies] Last: r (by Owenno)
by Latik
expected primary-expression before ‘int’
 
This is what i have example code in c++: #include <iostream> class Foo{ public: void bar(){ std::cout << "Hello" << std::endl; ...
[6 replies] Last: Why did you make the num1 and num2 global variables? What is Foo_max(... (by keskiverto)
by xystus
Help with string inputs on if statements
 
I'm trying to figure out how to make an input with a string thats part of an if statement. how i think it should be done #include <iostream> #include <stri...
[7 replies] Last: yeah, this is saying if you already defined string. my string is undef... (by xystus)
Trouble With Resetting the Board on Tic- Tac -Toe
 
I cannot seem to figure out how to reset the board in order to play again without spots already taken. Please help me out and if you see any style problems i wi...
[1 reply] : I cannot seem to figure out how to reset the board in order to play a... (by dhayden)
SDL_DisplayFormatAlpha
 
So a couple weeks back I was on here looking for ways to accelerate my game's performance, and learned about SDL_DisplayFormatAlpha. The end results of applyin...
[8 replies] Last: I've had it running flawlessly today on a 5 year old, low end laptop ... (by helios)
my simple ATM source has error..
 
Account, AccountList, taskManager,ioHandler <-classes in code. my code: Class part class Account{ private: string accNum; string pin; int balance; str...
[1 reply] : You have declared the default constructor on line 9, but did you defin... (by dhayden)
fseek() and random access
 
I dont know what I'm doing wrong here, but when I try to use fwrite() to update a file, the data doesn't change #include <stdio.h> #define SIZE 20 typ...
[2 replies] Last: Many thanks yay! (by dashbob)
please help for matrix diagonalization in c++
 
ı have to prepare a project. but ı don t know how can ı do this. program will find a matrix P for a square matrix A such that P^-1 A P
[15 replies] Last: I'm stuck :) Does anyone have any ideas? (by henrymorgan)
Math problem
 
Hi, my problem is this: double st; st = 100 * sin(360 * (10000/23)); Now when my calculator is working in radians st is evaluated to 97% which i...
[2 replies] Last: Here's the example from the tutorial. http://www.cplusplus.com/refere... (by wildblue)
May 2014 Pages: 1... 34567... 31
  Archived months: [apr2014] [jun2014]

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