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

Mapping/indexing a vector<string>
 
Hoping someone can point me in the right direction... I have a vector<string> that contains a wordlist. (for obvious reasons, im calling it "wordlist" Im tr...
[14 replies] Last: Its a bit late, but still.. I will need to do some reading to under... (by simeonz)
searching through a char array (1,2)
 
I want to make a program that the user enters a phone number like this: 1-800-ABC-DEFG and then spits out the number equivalent 1-800-222-3334. But I don't know...
[21 replies] Last: for this program I assumed that the user is inputting correct data. I ... (by shadowvillian)
difference between %lf and %Lf?
 
Is there any difference between %lf and %Lf?
[3 replies] Last: For printf (), the "%lf" is not valid -- it should be "%f". For sca... (by Duthomhas)
Polymorphism (function overloading)
 
Hi, I tried, but i can't change my way of thought of coding, so i deadly need help from you. I'm trying to overload a pure virtual function defined in bas...
[5 replies] Last: Thank you all for your precious answers. I can't believe that I'd "... (by hardcode)
by Ozge
OPERATORS???
 
I tried to complete the code it compiles but i am not sure if it is correct.Here it is.. // lastclass.cpp : Defines the entry point for the console applica...
[3 replies] Last: // lastclass.cpp : Defines the entry point for the console applicatio... (by Kyon)
by Obyz88
ARRAY 2D with char
 
i have: char text ={"one","two","three","four","six","seven","eight","nine"} i need output if i input=68 then the output=sixty eight..?? thx.. :)
[2 replies] Last: use std::map store number as key, string as value (by stereoMatching)
not understanding "push_back" if used recursively
 
#include <iostream> #include <vector> using namespace std; typedef struct Record { std::string name; bool isVisible; int ...
[3 replies] Last: Well, I can't do to much from my iPod (very hard to post), but you are... (by jimc)
What's wrong witht this code?
 
class RadianLongitudeLatitude : public std::pair<double,double> { public: RadianLongitudeLatitude (const LongitudeLatitude & longla) : std::pair<double,d...
[5 replies] Last: RadianLongitudeLatitude is a decendant of std::pair<double,double>::fi... (by teguh123)
What is wrong with this ostringstream code
 
void platformDependent::printAllLocation () { std::ostringstream oss; } I am simply trying to emulate http://en.allexperts.com/q/C-1040/2008/1/Convertin...
[3 replies] Last: well, I dont know where you can find that it requires it, but it does.... (by Seraphimsan)
How to Convert Degrees into Double
 
106°46'21.68 convert it to 106.66 for example. What would be a good code for that? I am newbie
[7 replies] Last: I can't really answer that :O I've never had to write the iostream hea... (by Seraphimsan)
by declan
Try/catch statement not catching bad_alloc
 
Hi, GDB (debugger) tells me that my program is crashing when it tries to allocate memory. The output says I have a segfault. I have the allocation enclosed in a...
[6 replies] Last: The only code before it in that function is Where did I say in ... (by rapidcoder)
by SebGR
Software prefetching
 
Hey there, In order to get a fast piece of code, I'd like to give a try to software prefetching (I don't want to use OpenMP at the moment). I'm running MSVS ...
[2 replies] Last: PanGalactic - Sorry for being at the wrong place, but thanks a bunch f... (by SebGR)
tpe casting - bitwise
 
Hi, which of the typecasting does a bitwise copy ? I believe it is cons_cast. is it correct ?
[2 replies] Last: Hi, Thanks for the answer and the link. (by srinath duraisamy)
by pizet
value checking function
 
Is there a function in standard C++ that would determine wheather a variable has value or not? I mean something like int a; somefunction(a); // false int ...
[6 replies] Last: the boost library provides boost::optional. That would be: boost::... (by coder777)
by Adidas
String
 
Hi I need to know when a row is over, how do i do it ? I know that in char the end is presented by "/0" but what about string ?
[4 replies] Last: and if getline(....) fails what it is returned ? it sets bits in the ... (by coder777)
Reading Other Application Data
 
Hi All, I have been assigned a task to read other application data installed in our client's computer running windows 2000 and then send it to serial port. The...
[no replies]
editing user input
 
Hi all, I am new to c++ and need some help to edit the user input. For example, I ask the user to enter the module code and afterward i need to take in the u...
[2 replies] Last: ahh thank you very much! it solved my problem! (by shanex88)
Simpler recursive solution?
 
I have this horrible piece of code void TNode::CreateMoveTree() { CreateNextRowOfMoves(); int numChildren = GetNumChildren(); for (int i=0; i<num...
[8 replies] Last: well m4ster r0shi showed how to solve it (if the level is indeed the i... (by coder777)
want to find the second smallest number without array
 
The question is read 10 integers and find the second smallest number without array.I think with array i can delete the smallest and after that find the smallest...
[1 reply] : int smallest, almost_smallest; If you replace smallest, then you sh... (by ne555)
by vivmen
why static main function not allow ?
 
Hi all, i think in c# or java static main function are there. but when i tried in c++ i got error static not allow here, why ? thanks in advance. i ...
[3 replies] Last: And I should also add that the C++ standard say that it should not be... (by guestgulkan)
January 2011 Pages: 1... 1415161718... 24
  Archived months: [dec2010] [feb2011]

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