General C++ Programming - August 2012 (Page 10)

Typedef of enum
 
#include <iostream> using namespace std; int main(){ typedef enum { false, true} boolean; boolean b = false; cout<<b; cin.get(); return 0; } ...
[4 replies] Last: thnx vlad ......that did it (by rhlgupta1383)
Good Lambda Functor and Thread -- C++11
 
To implement this you should know how to use c++11 lambda closures. There are a few ways to do this: The first way uses c++11 auto type detection: #incl...
[4 replies] Last: You should make it an article, not in the forum. (by viliml)
by S7krs
Class of bits, size compared to booleans
 
Hello! I have created a class that contains a char (8 bits, just like a Boolean), that introduces methods that can use every single bit. Now, I ran this code wi...
[9 replies] Last: For your information, the class std::bitset or std::vector<bool> is ex... (by aquaz)
Operator overloading
 
#include <iostream> #include <fstream> #include <string.h> using namespace std; class MyString { public: MyString(); MyString(const strin...
[2 replies] Last: When I ran this in the debugger, I got an access violation after a few... (by Stewbond)
Redefinition error
 
Hi i am sort of a newbie to C++ and i made an encryption/decryption program. but theres one problem i cant reserve bytes of memory for a string. my code is: st...
[9 replies] Last: and actually i have one more problem i tried using setclipboarddata() ... (by warrier)
password help
 
so i want to ask for someones password, but what they type shows up on the screen. i want to make it so that no matter what they type it will show '*'. and then...
[6 replies] Last: yep (by Aramil of Elixia)
by RyanM
Vectors & Passing Objects
 
ServiceProvider mySP(spUserName, spPassword); mySPs.push_back(mySP); vs. mySPs.push_back(ServiceProvider (spUserName, spPassword)); My Questions: 1...
[3 replies] Last: Thanks guys! Great answers :) (by RyanM)
strings 1-9 not printed ; array
 
I created a string array with 30 strings. But the strings 1-9 wont get printed, when I try to print them out using a for loop.
[10 replies] Last: Likely the error isn't at that part of the code. You may have an [out ... (by coder777)
Save a specific surface with SDL/OpenGL
 
Hello! i am learning OpenGL and i thought of making a paint program where you also could save the images and i wonder if there is any way to get a specific surf...
[5 replies] Last: Real quickly: f(src)=dst If you multiply the coordinates of a pixel in... (by helios)
Overloading the + Operator in a Derived Class
 
Greetings I have a class called Date and another called DateTime that is derived from Date. The class Date has a provision to overload the + operator. I am t...
[11 replies] Last: It works! It was such a stupid mistake that I had made and it only cam... (by Peter De Souza)
taking the last two letters of a string
 
I would like to make an if-statement. I would like make a if-statement that activates a function that should only be activated if the last two letters of a word...
[5 replies] Last: > could you maybe write that with, as an example ... Couldn't you hav... (by JLBorges)
Timing programm with chrono problem.
 
So I have my program that does some stuff for a some period of time. I'm trying to output time taken at specific points of program (Starting with Time taken to ...
[3 replies] Last: @NwN Hmm .. I think std::chrono::system_clock::now() - Started r... (by wizulis)
creating .dll files in c++
 
On page 54 this guide http://www.maths.manchester.ac.uk/~ahazel/EXCEL_C++.pdf gives an example of creating a dll file of a simple function. Then with this d...
[3 replies] Last: I have a 64 bit version of excel and apparently the visual studio 2010... (by jjday23)
by beakie
Projection
 
Can anyone offer a suggestion as to what is happening here? http://imgur.com/bHq67 I have been using this coordinate projection code for a while using bas...
[1 reply] : In case anyone wants to see the value of the cubes coordinates... ... (by beakie)
by ToniAz
Calling an Application from Another
 
Hello everyone! The title really explains what I want to do. To put into code, I want to do the following: int main() { // ... __CALL("file\path\run.exe")...
[3 replies] Last: It's best to make it a library. Programs don't pass data in a typesaf... (by kbw)
Is a polygon in a cube - voxelising
 
I'm coding a program that converts 3ds files into my own voxel file format how ever part of the process is to test whether any geometry (i.e. polygons) are in a...
[9 replies] Last: My next thought is to include boundry conditions in the planes by usin... (by Stewbond)
string storing in integer array!
 
what is the output? int i1 ={"\12345s\n"}; printf("i1=%d\n",sizeof(i1));
[4 replies] Last: Silly question: did you ever try to compile it to find the answer? Yes... (by viliml)
Dynamic Sorting Predicate (1,2)
 
Hello, I'm working on a type of sequencing problem, where the ideal position of an element is decided by nearby elements. As a type of experiment, I'm trying...
[21 replies] Last: I've only looked over this thread briefly but if you are determined to... (by jmadsen)
illegal use?
 
I have received an error saying "Illegal use of this type as an expression", why is my compiler throwing this error? if (m_pPlayer->GetPlayerPos().x...
[2 replies] Last: sorry about that. The question was rushed =D and yea i was meant to be... (by programmeraie125)
by iantac
Fibonacci Search Algorithm C++???
 
So now I'm creating a program that will search a string using the Fibonacci Search Algorithm. The problem is that the program can't find 9,6,5,3, and 2 #inclu...
[4 replies] Last: What I mean is, it's sorted by the numeric value the strings represent... (by helios)
August 2012 Pages: 1... 89101112... 31
  Archived months: [jul2012] [sep2012]

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