71 Posted Topics

Member Avatar for number87

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 { …

Member Avatar for sidatra79
0
1K
Member Avatar for minigweek

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 …

Member Avatar for sidatra79
0
641
Member Avatar for krauz2

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) …

Member Avatar for krauz2
0
86
Member Avatar for mbayabo

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 …

Member Avatar for chunalt787
0
140
Member Avatar for adrian116

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 …

Member Avatar for adrian116
0
105
Member Avatar for lobhater

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

Member Avatar for sidatra79
0
112
Member Avatar for kurorokhristoff

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]

Member Avatar for Lerner
0
2K
Member Avatar for Se7Olutionyg

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 …

Member Avatar for sidatra79
0
104
Member Avatar for nkw0820

Hi maybe this can help u: [url]http://www.flipcode.com/archives/Interfacing_Visual_Basic_And_C.shtml[/url]

Member Avatar for sidatra79
0
73
Member Avatar for gopi17

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 …

Member Avatar for sidatra79
0
111
Member Avatar for biggz

Check my post in this thread: [url]http://www.daniweb.com/forums/post704847.html#post704847[/url]

Member Avatar for sidatra79
0
234
Member Avatar for sidatra79

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 …

Member Avatar for sidatra79
0
117
Member Avatar for anny**

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 () …

Member Avatar for sidatra79
0
262
Member Avatar for nizbit

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 …

Member Avatar for grumpier
0
102
Member Avatar for launic

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 …

Member Avatar for sidatra79
0
197
Member Avatar for ART01

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() : …

Member Avatar for sidatra79
0
109
Member Avatar for neverness

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 …

Member Avatar for neverness
0
254
Member Avatar for sidatra79

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 …

Member Avatar for ivailosp
0
90
Member Avatar for tonyaim83

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 …

Member Avatar for sidatra79
0
146
Member Avatar for sidatra79

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 …

Member Avatar for sidatra79
0
211
Member Avatar for sidatra79

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<<" …

Member Avatar for Alex Edwards
-1
108

The End.