General C++ Programming - February 2013 (Page 18)

HELPP!
 
My question is are there various ways that I can approach this program. I.e. do I have to use switch statements? /* NumToTxt Creates the appropriate word f...
[1 reply] : Please use code tags and then edit your first post to have it. (by greenleaf800073)
execute function if user closes console
 
hello i would like to implements something in my code that clears the value of my variables when the user closes the console. could someone tell me how to do th...
[3 replies] Last: What about using a destructor? I'm not sure if it's the console which... (by Stewbond)
execute a function while in a breakpoint
 
For easier debugging, I would like to execute an own (predefined) function while beeing in a breakpoint (e.g. print some variables to a file). Does there exist...
[2 replies] Last: Thanks for that detailed answer. I did not know 'gdb'. It seems that I... (by trialNerror)
std::unordered_map with std::vector<char> key
 
Hello, how exactly do I add a hash function so that std::vector<char> can be used as keys in std::unordered_map , seeing as it already works fine for std::s...
[5 replies] Last: > Would you consider it bad practice to specialize std::hash()? Like s... (by JLBorges)
Is this out of scope?
 
I have been testing this code for about an hour now, and still do not get why it fails. When I try it in a test program it works, but in the normal program it f...
[15 replies] Last: I understand now, thank you to those that helped :) (by Script Coder)
Help with Employee Program
 
Hi I am currently working on a project and I am having a hard time getting it to run correctly. I have pasted all of my files here http://pastebin.com/HsPzCR...
[no replies]
TicTacToe with classes
 
I have this TicTacToe program that needs finishing. All the code is finished, but I'm getting runtime errors. It is printing out junk values from my array when ...
[5 replies] Last: Okay good. Now it's printing out the blank board like it's supposed to... (by kirbster329)
Custom vector AND memory allocator
 
OK, I THINK I have this functional now. Finally, now that I had a good few hours at once to sit down and work on it. Latest commits can be found at: Vector ht...
[6 replies] Last: I think this thread http://stackoverflow.com/questions/3671234/what-is... (by naraku9333)
String Compare problem
 
fscanf(myScriptFile , "%s", &YO); if (YO.compare("Start") == 0) { Started = true; } for some reason YO.Compare doesnt return 0 at all I ...
[3 replies] Last: std::string does not have an implicit conversion to a char * which i... (by AbstractionAnon)
events in c++
 
hello i would like to use something like events in c++ such as when an user presses a key. is that possible in a console application and if so could you give m...
[1 reply] : Are you using C++11? http://scriptionary.com/2011/07/05/c-events-with... (by AbstractionAnon)
by LB
PImpl+unique_ptr & defaulted MAO
 
This is just a helpful tip for anyone using the PImpl idiom with std::unique_ptr and a defaulted move assignment operator in the main class - you can't declare ...
[6 replies] Last: Ah, ok. I like being more explicit though because it's something that ... (by LB)
gethostbyname
 
I have code here that is designed to do exactly what I want: it prompts the user to enter a domain name, then uses gethostbyname, or gethostbyaddr to resolve...
[9 replies] Last: Have you read the documentation for the hostent structure at all..? ho... (by Thumper)
What's left in the array if only a part of it is initialized ...
 
So if I have something like this int AR ; cout<<"Enter the elements of the array : "<<endl; for(int i = 0 ; i < 5 ; i++) cin>>AR ; so in the c...
[1 reply] : They will be zero-initialized. For example int AR = { 1, 2 }; AR w... (by vlad from moscow)
Visual Interface for Password Entry and Retireval - Software that i have writtern
 
I have written code for a password management system. It is called VIPER who's acronym is as Above. I have shared it all on my blog. vipersoftware.blogspot.com...
[no replies]
Code compiles successfully, yet previous day is blank
 
//#include "stdafx.h" #include<iostream> #include<cmath> using namespace std; //class declaration class dayType{ public: int presday; int pre...
[2 replies] Last: Ok, nevermind guys. fixed the stupid error int dayType::prev_day(int... (by Stewie k)
manipulator
 
What is a manipulator? Justify this definition with a program sample
[1 reply] : Are you talking about io manipulators, or something else? (by MiiNiPaa)
cout and cin objects of iostream class
 
i ran the following code in the latest version of code::blocks and it tells me that the objects cout and cin are not declared in this scope. what is the problem...
[7 replies] Last: are you telling me that the fucntions have been changed? is that why ... (by closed account NwvkoG1T)
Compiles successfully but calculations give wrong answer
 
Can anyone please tell me what's going on here. I'm using MSVC++ and it builds sucessfully but somewhere something is obviously messed it. Once i try to debug i...
[14 replies] Last: Thanks for all the help guys, much appreciated!!! (by Stewie k)
Assaign a vector to a vector?
 
I want to create a grading program that the user inputs a name and then on that value (name) there is a vector of doubles to represent his/her mark and then cal...
[1 reply] : You can use map<string, vector<double>> http://cplusplus.com/referen... (by MiiNiPaa)
by paul23
Can xml-schema be used to define meta data (using xerces)?
 
say I have an xml-file. Now what my program does depends on the "element". Is it possible for xml schemas to define the action that the program should do? Ie is...
[1 reply] : It is completely possible. You might want to make sure that you get fu... (by MiiNiPaa)
February 2013 Pages: 1... 1617181920... 43
  Archived months: [jan2013] [mar2013]

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