General C++ Programming - November 2013 (Page 10)

about variant type
 
i have my own variant type: // *** ADDED BY HEADER FIXUP *** #include <cstdlib> #include <iostream> #include <string> // *** END *** #ifndef VARIANT_H_IN...
[no replies]
by Rbroke
Palindrome program
 
The instructions for the program is bool isPalindrome = true; queue<char> Q; stack<char> S; string str; cout<< "Enter a word : "; getline(cin, str, '\n'); ...
[2 replies] Last: Thanks, the while loop and a few tweaks got it working. I had tried ... (by Rbroke)
Is there any other way I can make this program better?
 
//string reverse algorithm. #include <iostream> #include <string> using std::cout; using std::cin; using std::endl; using std::string; int main() { cout <<...
[2 replies] Last: Since this is C++, I would just stick with std::string unless you ha... (by long double main)
segmentation fault
 
Ok, so I'm getting a segmentation fault when I try to solicit values for the member variables of a Roster object from the following code: #ifndef ROSTER_H...
[6 replies] Last: Found the problem. In my Student class, there existed Date objects as... (by David Reghay)
by bssam
question about a program code
 
i have this code need to get to work what i should do #include <stdint.h> #include <stdbool.h> #include "C:/ti/TivaWare_C_Series-1.1/inc/hw_types.h" ...
[no replies]
Understanding the order of operations in C++
 
Hi, I'm a little confused about the way C++ handles the order of operations, it seems to be different. For instance I have the following calculation which to m...
[4 replies] Last: Got it, thanks a lot for the good explanation, it now make sense. (by fstigre)
Must Declare "Spencer" in Scope
 
I'm trying to make a joke for my friends, and it says I must declare "Spencer" in the scope, how do i go about doing this? #include <iostream> #include <stri...
[2 replies] Last: Also the comparison will fail if they enter something like "garrett" i... (by Catfish666)
need help from yesterday - urgent
 
hi, i got lots of errors while using inner class:tenant in class:building i don't know why.. could someone help? here are some of the errors, i coudn't copy ...
[4 replies] Last: You use the <> format button that you see when posting and editing. (by MikeyBoy)
Code for Medical Application
 
I'm planning to build a free medical application for windows mobile, which contains information of various diseases, their symptoms and patient counseling point...
[no replies]
Finding the function documentation for the following header file
 
Hi everyone, I would like to see what functions the following header file has: #include <tf/LinearMath/Transform.h> Can anyone guide me to the website tha...
[4 replies] Last: I wanted to know if there was a summary of the functions (similar to t... (by Jason Plumb)
by yhu420
Map issue
 
Hi everyone, This is actually the first time I use maps and I have an annoying issue: class Lol { public: Lol(string); //other things } class Thing...
[3 replies] Last: Perhaps a more important issue is to understand why a default constr... (by MikeyBoy)
Creating an Event Design
 
I'm trying to create a system where an object can post events to an event queue, and later the events can be processed. Right now I have something like this: ...
[4 replies] Last: What would you think if a HungerEvent was created by clicking on a but... (by Lowest0ne)
input the text and out put text is not working
 
#include <iostream> #include <string> #include <fstream> #include <sstream> #include <vector> #include <iostream> using namespace std; typedef std::stri...
[no replies]
exception handling
 
writing a program that requires exception handling. if an error occurs, i what the program to go back to the begging of the loop. i tried using break but that j...
[1 reply] : Put your try .. catch block around the loop body, and don't break ... (by Duthomhas)
by LB
Why isn't referencing other parameters in default values allowed?
 
http://ideone.com/nuQAcK #include <iostream> #include <vector> void f(std::vector<int> const &v, std::vector<int>::const_iterator it = v.end()) { } int main()...
[4 replies] Last: Ah, thanks, that makes much more sense now. I guess it would be extra ... (by LB)
Help with C++ programming on Array.
 
This is what I have to do. First declare an array that is large enough to hold at most 25 floating point values. You are to ask the user to enter a valu...
[2 replies] Last: I can't seem to fix the average of the values greater than 100. I d... (by Duthomhas)
by Yueeng
Problem with bool iterator
 
Hey guys, I got this weired problem with a vector<bool>::iterator, probelm occurs when executing *it=!*it (I'm reversing the bool value, true to false, and fal...
[2 replies] Last: http://www.cplusplus.com/forum/general/112111/ ¿what is LAMP? > how ... (by ne555)
need help with this program
 
So this is my assignment and i am so close to finishing it i just keep getting some errors. The local Driver's license office has asked you to write a progra...
[7 replies] Last: i was thinking of writting a for loop as so for (count = 0; count < v... (by jarmstrong21)
Subtract in a string with decrementation
 
Hi, First, here's my code : >>>>> std::vector<std::string> x = split("3 5", ' '); int total = 0; // then we loop over the elements for(size_t i = 0; ...
[2 replies] Last: It is not uncommon for (- 3 5 7) to mean (3 - 5 - 7), so there is no p... (by Duthomhas)
How to READ pointer of a struct type in file in C++
 
This is a c++ Code. I want to read a address to a pointer. When I try to do so it generates an error. I did is >> obj1 .contentAdress; in main. struct node3{ ...
[12 replies] Last: Thanks a lot Duoas, I don't know how to thank you! Its awesome! (by Rehan FASTian)
November 2013 Pages: 1... 89101112... 46
  Archived months: [oct2013] [dec2013]

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