71 Posted Topics
Re: Hi I post u a code where u can see used all those u mentioned (ctime, time_t, difftime,struct tm, mktime). Moreover I have to say that Ancient Dragon-s code works both inside and outside the main. [code=c++] #include <iostream> #include <ctime> double diffclock(time_t clock1,time_t clock2) //Using time_t & difftime { … | |
Re: Hello the fact that your code doesn't work for more than 3 pegs implies that u defined either the recursion base case or the recursion step wrong. Therefore I post u the following working code: [code=c++] #include <iostream> void GetCorrectMoveSequence (int n, char startT, char goalT, char tempT) { if … | |
Re: this sounds nice ....u r trying it in php.... and here is for c++......:confused: [QUOTE=krauz2;710335]How can I have a switch command send to a ftp site? I am trying this out in php. Here is what I have. Instead of $to_email is there one for URL? Thanks everyone. Erich switch($attn1) … | |
Re: Hi maybe the following suits your problem: [code=c++] #include <iostream> class Account { public: Account() : initBal(0),idnum(0),creditLimit(0.0) {} Account(int id): idnum(id) { initBal=100; creditLimit=500.0; } Account(int balance,int id): initBal(balance),idnum(id) { creditLimit=100.0; } public: void somefunction() { std::cout<<"Initial balance is: "<<initBal<<std::endl; std::cout<<"id is: "<<idnum<<std::endl; std::cout<<"credit Limit is: "<<creditLimit<<std::endl; } Account& operator=(const … | |
Re: Concerning the first I would like to add: const int*a; and const int *a; [U]are the same.[/U] and are read: a is a pointer to a constant int. ---- We need a constant pointer when we need that a pointer once initialized it cannot be pointed to anything else->[U]works like … | |
Re: Maybe this page could be helpful to u: [url]http://cs.baylor.edu/~donahoo/practical/CSockets/c++.html[/url] Or maybe this book could help u: [url]http://proquest.safaribooksonline.com/0201604647/pref01[/url] :D :D | |
Re: Hallo u might find helpful my previous post in: [URL="http://www.daniweb.com/forums/thread148280.html"]http://www.daniweb.com/forums/thread148280.html[/URL] | |
Re: Hi here is your way to a good grade.... :D [code=c++] // grade.cpp // display the letter grade corresponding to an exam // score assuming a noormal scale # include <iostream>; void displayGrade (int); int main () { int score; std::cout << " Enter your score to get a grade … | |
Re: Hi maybe this can help u: [url]http://www.flipcode.com/archives/Interfacing_Visual_Basic_And_C.shtml[/url] | |
Re: Hi I use the model-driven "rhapsody" software from telelogic, where I create an UML class diagram, for which most of the code then is automatically generated. In addition, I can choose to "reverse engineer" a preexisting code to an UML class diagram. According to the rhapsody documentation this could be … | |
Re: Check my post in this thread: [url]http://www.daniweb.com/forums/post704847.html#post704847[/url] | |
Hello everybody, I am looking for some clarifications/definitions regarding some special concepts for a better OOP design.. I already have some idea for some of them, however I would like to hear what more experienced programmer have to say. :D So lets start... [code] Could u provide a short definition … | |
Re: Hallo first of all, I think the way u code IS NOT STANDARD C++ !!!! Instead it looks more like C to me. Maybe it is not important for u , maybe it is for your professor :d Here is what u wanted: [code=c++]#include <iostream> #include <iomanip> int main () … | |
Re: Hi, keep also in mind that [B]whenever u allocate (using the -new- operator) an object which has a constructor, AN INITIALIZATION is mandatory.[/B] This is simple when u haven't defined any constructor, since then the default constructor is called. On the other hand if u defined only e.g. a 2-argument … | |
Re: What about: [code=c++] //typedef hash_map<string,wordData,hashFunc> wordHash; //-->because i dont know your much things about your wordData...I am using int as an example typedef hash_map<std::string,int> map_type; //wordHash hashofwords; //--> map_type my_map; ... my_map[ "foo" ] = 3; my_map[ "socrates" ] = 7; ... //(after passing in a string s to a … | |
Re: Here sth might be what u r looking for: [code=c++] ///////////// class CLink { public : CLink(CLink * pNext, int id) : _pNext(pNext),_id(id) {} int Id() const { return _id;} CLink * Next() const { return _pNext;} private: int _id; CLink* _pNext; }; ///////////// class CList { public: CList() : … | |
Re: U did not mention what kind of tree u r trying to code. So I suppose that you r trying to code a binary tree. In such case u could use the following: [code=CPP]#include <iostream> //The binary tree class template template<class T> class aBTclass { public: //--Constructors and operations----------------------- //--Construct … | |
Does anybody have any idea why the following code causes a memory error? Thanks everybody in advance :D [code=CPP]#include <stddef.h> // some older implementations lack <cstddef> #include <time.h> #include <math.h> #include <stdlib.h> #include <vector> #include <algorithm> #include <list> #include <deque> #include <set> #include <iostream> #include <iomanip> typedef double element_t; using … | |
Re: Hi here is my code that i think could be the solution to your problem. It compiles using g++ in my ubuntu boot: [code=CPP] ..... #include <string> #include <set> #include <map> #include <utility> //Dont forget this - U need it for using the "pair" ..... std::string str1="test1"; std::string str2="test2"; std::string … | |
Hallo everybody. I am a student trying to extend my knowledge in cPP while using UML and system modelling. I created a "vector template class" using the rhapsody system modeling tool for storing different data types. I used the template to store int and float data types successfully using either … | |
I am trying to implement the composite "structural pattern". The attached code compiles but when I run the exe file the memory collapses. Here is the code: [code] #include <iostream> #include <iomanip> class CTreeComponent { public: virtual void traverse(int)=0; }; class CTreeLeaf:public CTreeComponent { public: CTreeLeaf(int wert):m_wert(wert){} void traverse(int tiefe){std::cout<<m_wert<<" … |
The End.