Need help in Recusion
char* StrCpy(char* output, char* input)
{
if (*input != NULL)
{
*output = *input;
*output++;
Type: Posts; User: justdoit22
Need help in Recusion
char* StrCpy(char* output, char* input)
{
if (*input != NULL)
{
*output = *input;
*output++;
ya it now looks right
i previously tried to const getCount by trying these two options
int const getCount() { return count; }
const int getCount(){ return count; }
but both didnt work
OK you advised to use this
bool operator < (const MyString& left , const MyString& right)
{
return (left.getCount()) < (right.getCount());
}
but it doesnt compile in VC++6.0 errors are:...
replace
for(a =1; a<x;a++)
with this one
for(a =1; a<x-1;a++)
wont give any logical errors more
------------------
Ok what i did at the end of the day was that i provided getter for MyString::count
and defined a Global comparison operator as this
bool operator < (MyString left , MyString right)
{...
can some one tell me how shall i impelement the predicate function which copares two classes before sorting????
i have a class MyStrVec which contains a vector of class MyString.
i want to use the std::sort function on that vector and wanna sort all vector members by the int count variable in MyString class....
replace this line
cout << card;
with this line
cout<<card.c_str();
i hope it will work fine now
yeah it works fine with subdene solution.... i actually had another bug in my original complete program
thanx all ppl
ok i tried this and thsi isnt working too
neither in VC++ nor on Solaris GNU compiler
class Schedule
{
public:
Schedule()
{cout<<"In Daily ctor"<<endl;};...
ignore this line at the end
newdaily[dailyCounter].printSchedule;
and cosider this correct
newdaily[i].printSchedule();
now i have a class Schedule.
class Schedule
{
public:
Schedule(int &dailyCounter)
{ cout<<"In Daily ctor"<<endl;
dailyCounter++;
};
i had to include these files in Event.h
and now my very first declaration of Event works fine....
#include <string>
#include "Time.h"
#include "Date.h"
i had to include those files so that...
ok i put STATIC in front of a DATE and TIME member as belo
in Event.h
#ifndef _EVENT_H_
#define _EVENT_H_
class Time;
class Date;
ok just tell me that have i declred the class Event correctly or not (assumung Date and Time are present in their .h and .cc files)??
hey ppl ive got a little problem here...
#ifndef _EVENT_H_
#define _EVENT_H_
class Time;
class Date;
thanx man it works....
wondering i couldnt think of it earlier.. perhaps new @ programming
thanx again
Hello ppl
im trying to get user input using getline. i give this statement
while (true)
{
if (!getline(cin, string, '/'))
{
cout<<"invalid input"<<endl;
continue;