General C++ Programming - July 2011 (Page 19)

by moudiz
a little "questions"
 
helllo guys ..as its my first topic here i have to say: wow thats alot of information in this forum... actually am beginner to c++ i know the basics(classes,vec...
[1 reply] : i know the library <ctime> and i have only used it with <cstdlib> sra... (by Athar)
Can you print out the value of a variable in a MFC MessageBox
 
Hey, I am wondering if it is possible to display the value of a varible in a message box. I am using MFC C++ 6.0. I am displaying a messagebox by using AfxMess...
[1 reply] : It is possible. You just have to convert your variable to a c-string. ... (by m4ster r0shi)
by UAV
Virtual keyword
 
Why is the virtual keyword (line 23) needed in the following? What exactly does it do in this program? #ifndef ros_Range_h #define ros_Range_h #include "...
[2 replies] Last: http://www.cplusplus.com/doc/tutorial/polymorphism/ (by webJose)
by h9uest
keyword virtual before overriding function in Derived class
 
Hi: In terms of OOP with C++, consider: class Base { public: virtual void print () { cout << "Base::print" << endl; } }; class Deriv...
[3 replies] Last: @all Guys, thanks for the inputs! My compiler supports override, whi... (by h9uest)
don't know what is this. las=set_difference() in c++
 
char *last; char result ; last=set_difference(Alphabet,Alphabet+lanA,AlphaNume,AlphaNum+lanAN,result) //thus anyone know how this code work???
[9 replies] Last: If you want to implement a set difference algorithm, you can do someth... (by m4ster r0shi)
When do we know that a constructor is required?
 
I'm not a beginner nor a professional in C++ programming.I'm with the basics.I know how to create a constructor & its types. My question is- 1.When do we use ...
[7 replies] Last: Type s = t; calls the appropriate constructor, or copy constructor i... (by Mathhead200)
Trusted, 2s-Complement Binary Conversion
 
Hi. Does anyone have any trusted code for converting various 8/16/32/64-bit, 2s-complement, binary fields to native integers? I am a relatively weak (active...
[2 replies] Last: Thanks, hamsterman. Once I get a copy of the data feed, I'll just try... (by iansblues)
by gizzmo
How to return a string?
 
Hi, I have a problem with a function that I wrote std::string timehms(double x) { char *buffer = new char ; int hh, mm, ss; hh = int(x / (60 * 60)); mm = i...
[4 replies] Last: Well, as is often the case, I could not finish a response I began typ... (by Duthomhas)
Close runtime window of C++
 
hey guys i need to close the runtime window of C++..i mean i need the equivalent code of "end" of VB6 to terminate the C++ runtime without clicking its close bu...
[2 replies] Last: Just like in VB6, it is an awful practice to terminate programs this w... (by webJose)
need help with functions using array
 
we are creating a array to output intergers in increasing order, i have a problem with when the result outputs i dont want it to tell the repeated number, i thi...
[1 reply] : cmPos is 0. I don't see what purpose it serves.. You want to erase ... (by hamsterman)
Fork()
 
I was trying to learn TCP/IP sockets and grasped all the concepts. But when reading the client source code I stumbled upon a function- fork(). I have no idea wh...
[1 reply] : http://www.cs.cf.ac.uk/Dave/C/node22.html#SECTION002230000000000000000... (by Catfish)
"log4cpp::Category& category = ..." Syntax??
 
Background‬‬ : The ampersand in "log4cpp::Category& category = ..." is beyond my knowledge. I am actively learning C++, but I am still very inexperienced. ...
[1 reply] : & in a declaration notes a reference. http://en.wikipedia.org/wiki/Ref... (by hamsterman)
Fibonacci Sequence How to Sum the Average?
 
Help to get the Average of the Last Final results of the 3 Fibonacci Sequence. I need to create a program that will ask the user to continuously enter a term...
[1 reply] : If a user enters 2, 4 and 6, you'll print 1 1 1 1 2 3 1 1 2 3 5 8 ... (by hamsterman)
by ridz91
Validating the date format
 
I want to restrict my date format to dd/mm/yyyy type.. with a specific range for date, month and year. Although, I have put the constraints for range but I am u...
[1 reply] : If you want to force the user to write dd/mm/yyyy in one line, read th... (by hamsterman)
obj in memory deleted multiple times: no runtime error !?!
 
Hi! This is a question about "reserving memory" (new...) and then freeing it with delete. Usually if I delete some memory more than once... a runtime error cr...
[6 replies] Last: Ok the issue has been resolved at the gcc bugtracker. See the comment ... (by JohnBrystone)
Trouble with some string array logic
 
Basically what I am trying to do is take a 50 by 50 by 21 array of strings(line by word, by character) and sort them into a new 2 dimensional array with rows be...
[1 reply] : Is toWord supposed to map strings form textArray to wordArray ? Eithe... (by hamsterman)
ignore key presses during sleep() function
 
I want to ignore all key presses while sleep function is going on. example: void main() { char option,option2; int timer = 1500; do { bool finish...
[3 replies] Last: Thank you!!!!!!! (by cjhawks1991)
Interpreter errors
 
Hi, I learnt that interpreter executes code line by line. So my guess is interpreter shows only one error at a time, i.e the current one. Am I right?
[2 replies] Last: Yeah am aware of C++ being an Compiled language. Never used an interpr... (by howtechstuffworks)
by sirz2u
STL Map Code Gen Takes Forever
 
I'm pretty new to STL, and I am having a problem with initializing a static map. I am trying to use this to refer to a string by ID. When the map starts to get...
[5 replies] Last: I have to agree with sohguanh here. You have a database for your infor... (by Zhuge)
DELETE DUPLICATEs in C++
 
Anyone know how to make this program??? The program goes like this. OUTPUT: string: aabnghhbf result: nfg
[12 replies] Last: ok.. tnx for your help. My problem was solve. (by gujinni)
July 2011 Pages: 1... 1718192021... 30
  Archived months: [jun2011] [aug2011]

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