Beginners - April 2011 (Page 47)

by caneta
Transform a boost::variant into its former type
 
If I have a variant variable such as boost::variant<int, float, double, string> var and I give to it a value...lets' suppose an int: var = 1; Of...
[2 replies] Last: Yeah, it was not so difficult: int a = boost::get<int>(var) Thanks... (by caneta)
Divisor Help
 
I have to write a program for a class that reads an unknown number of positive integers and for each number, uses a nested counter-controlled while loop to prin...
[3 replies] Last: Analyze the algorithm of finding the divisors of one number (n) first.... (by hamsterman)
Outputting digits of an integer separetely.
 
Hi, the program I am working on in my spare time is supposed to take as an integer a number and output the digits of the number separately as well as the sum of...
[2 replies] Last: You can't directly type cast an integer to a char as the ASCII code ... (by lnk2019)
Recording the Backspace Character
 
Hello, I have a quick question about recording a backspace character in an opened file. Now I have searched for a couple of hours and figured out that in order...
[4 replies] Last: Ahh ok I understand that sot he temporary file idea is a bust. So my ... (by Miseria)
Try/Catch function
 
Can anybody explain to me what this is, and how it works in a simple way?
[5 replies] Last: #include <iostream> using namespace std; bool isPrime(int n) ... (by Mathhead200)
What to study next?
 
Hiya. I've recently finished reading "C++ Primer 5th Edition", by Stephen Prata. I feel that it's given me a good grasp of the language, but I still feel very...
[8 replies] Last: The STL contains a wealth of capabilities that you may not have been f... (by Alrededor)
sort array
 
I am trying to sort in ascending order but can't seem to make this work. #include <iostream> #include <fstream> using namespace std; int main ( ) { ...
[3 replies] Last: I go cross-eyed trying to read your code. Please use from now on.... (by ciphermagi)
Sumandcomputeavg
 
I'm trying to understand how to do a void sumandcompute. The project i'm working on wants me to do... outer for loop walks through number of employees in...
[no replies]
by snakec
c++ XML file parsing problem
 
hi everybody i want to parse an XML file with xerces Dom parser but could not succeed here is code for my xml file which i have to change <?xml version="1.0"?...
[no replies]
help a beginner please.
 
hi, so for a class im taking in c++ I have to program an application that will let you select your medication and then after you select it you can tell how many...
[6 replies] Last: vector<coder*> me; vector<coder*>::iterator it; vector *temp = new ... (by ciphermagi)
by linkj7
Comparing Arrays
 
I guess this has somehow slipped right by me but I cannot seem to figure out at all why when I compare these two arrays like so, it doesn't work: #include <i...
[6 replies] Last: Use std::string and operator==. For char arrays, use std::equal. http... (by Athar)
URGENTTT HELP IN C++ ERROR: too many characters in character constant
 
I have a question, I need to know if it is possible to do a switch case using a string What I did is the following: string *item_name = x.substr(i,x.size()-1...
[1 reply] : You can only use switch with integral types, so that won't work. And s... (by Athar)
Console Application doesn't do anything
 
Hello, I recently bought the C++ for dummies 2009 edition, and it came with Code::blocks to write the code. However, whenever I make a program and try to run it...
[4 replies] Last: edited (by Patriots12)
Utilizing Different Areas of an Array
 
in this program you can use an input file that has a record of a bird watching event to do a few calculations with the program. its a project for school, and i ...
[8 replies] Last: how do i predefine the parameters of a function using a struct? let'... (by matsom)
help with pointers
 
Hi I a function that splits an array of chars into tokens and then converts each token into a float number, the code is the following: float* splitContent(c...
[1 reply] : [co de] "Please use code tags" [/co de] The return value of your f... (by ne555)
Can you please suggest me a good book?
 
Hi, I'm looking for a book which teachs you c++ applications (NOT console applications). I've tried a game programming book but it's a little too advanced...
[7 replies] Last: I've also heard good things about GTK+. All three of these libraries ... (by jlamothe)
Need help, function to read values from a text file!!!!!?!
 
The function needs to read in values from a text file. The file should be named something like character_data.dat or whatever the file extension should be .dat ...
[no replies]
Quick question for experts....
 
Hello everyone, thanks for taking on this topic. I have a read file ("exampleIn.txt") and i get the input from there and after the program runs i print in a...
[5 replies] Last: I am confused, a litle advise or example maybe. I would apreciate i... (by detroit)
2D arrays
 
hey everyone!!! i want to know how to display a 2D array. all it has is a bunch of #s, letters, and symbols. #include <iostream> using std::cout; usin...
[8 replies] Last: thanx yall it works great (by cainen172)
Having trouble looping with getline()
 
I'm having a problem while trying to loop with the getline function. The program compiles but after being prompted for number of repetitions, it displays: Na...
[15 replies] Last: My problem to begin with was when trying to input the name, getline wo... (by Brianzor)
April 2011 Pages: 1... 4546474849... 55
  Archived months: [mar2011] [may2011]

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