dev-cpp-users Mailing List for Dev-C++ (Page 4)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
(1) |
2
|
3
(2) |
|
4
(3) |
5
(4) |
6
(2) |
7
(5) |
8
(6) |
9
(5) |
10
(3) |
|
11
(2) |
12
(2) |
13
|
14
(2) |
15
|
16
(7) |
17
(3) |
|
18
|
19
|
20
(9) |
21
|
22
|
23
(2) |
24
(4) |
|
25
(3) |
26
(2) |
27
(2) |
28
(8) |
29
(2) |
30
(5) |
|
|
From: bhadram r. <bha...@ya...> - 2005-09-05 10:05:22
|
Dear friends,
I'm facing with a problem with templates.I'm including all my code at end.The sole purpose of my program is that to use heap algorithm which will take template parameter like this
MaxHeap<Array<String> > m(10);
m.initilize(a,10,10);
where String is self created class which will work same as string class and Array class main function is to use indexing starting with 1 rather than zero. The problem is that in the following line
if((c<currentSize) && (heap[c]<heap[c+1]))
c++;
As my knoweledge goes in accordance with operator precedence heap[c] is worked out([] operator is over loaded in Array class) and as you see in the code it returns String object, in according to the following code in Array class.As Array class is instatiated as Array<String>, then template must do the same.The same will happen with heap[c+1] and finally < must operate on two String classes objects and < overload operator must operate and returns the int value which is furhter evaluated. But I'm getting compilation errors like this.
T& operator[](int i)
{
return data[i-1];
}
I couldnt understand why Array<class bhadram1:String> is transferring while comparision because in precedence it is low.I couldnt understand what is happening and i want to clear about templates. Please help me in this aspect.
compilation errors:
:\cpppractice\sep3\heap1.h(72) : error C2039: 'getPointer' : is not a member of 'Array<class bhadram1::String>'
d:\cpppractice\sep3\heap1.h(115) : see reference to function template instantiation 'int __cdecl bhadram1::operator <(class bhadram1::Array<class bhadram1::String> &,class bhadram1::Array<class bhadram1::String> &)' being compiled
d:\cpppractice\sep3\heap1.h(72) : error C2039: 'getPointer' : is not a member of 'Array<class bhadram1::String>'
d:\cpppractice\sep3\heap1.h(115) : see reference to function template instantiation 'int __cdecl bhadram1::operator <(class bhadram1::Array<class bhadram1::String> &,class bhadram1::Array<class bhadram1::String> &)' being compiled
d:\cpppractice\sep3\heap1.h(65) : error C2039: 'getPointer' : is not a member of 'Array<class bhadram1::String>'
d:\cpppractice\sep3\heap1.h(117) : see reference to function template instantiation 'int __cdecl bhadram1::operator >=(class bhadram1::Array<class bhadram1::String> &,class bhadram1::Array<class bhadram1::String> &)' being compiled
d:\cpppractice\sep3\heap1.h(65) : error C2039: 'getPointer' : is not a member of 'Array<class bhadram1::String>'
d:\cpppractice\sep3\heap1.h(117) : see reference to function template instantiation 'int __cdecl bhadram1::operator >=(class bhadram1::Array<class bhadram1::String> &,class bhadram1::Array<class bhadram1::String> &)' being compiled
Error executing cl.exe.
heap.obj - 4 error(s), 0 warning(s)
# include <iostream>
# include <Heap1.h>
# include <String1.h>
using namespace std;
using namespace bhadram1;
int main()
{
int array[10]={20,12,35,15,10,80,30,17,2,1};
String str[10]={"first","second","third","fourth","fifth","sixth","seventh","eight","nine","ten"};
Array<String> a(str,10);
MaxHeap<Array<String> > m(10);
m.initilize(a,10,10);
//m.print();
return 0;
}
Heap1.h file:
# include <iostream>
using namespace std;
namespace bhadram1
{
template<class T>
class Array
{
//friend ostream& operator<<(ostream& ostr,String& s);
protected:
int size;
T* data;
public:
Array()
{
size=1;
data=new T[1];
}
Array(int n)
{
size=n;
data=new T[size];
}
Array(T* a,int const s)
{
size=s;
data=new T[size];
for(int i=0;i<s;i++)
{
data[i]=a[i];
//cout<<data[i]<<endl;
}
}
Array(Array<T>& a)
{
size=a.size;
//delete[] data;
data=new T[size];
for(int i=0;i<size;i++)
{
data[i]=a.data[i];
}
}
T& operator[](int i)
{
return data[i-1];
}
T& operator=(T& a)
{
return a;
}
friend ostream& operator<<(ostream& ostr,T& a);
friend int operator<(T& a1,T& a2);
friend int operator>=(T& a1,T& a2);
};
template<class T>
int operator>=(T& a1,T& a2)
{
return (strcmp(a1.getPointer(),a2.getPointer()>=0));
}
template<class T>
int operator<(T& a1,T& a2)
{
return (strcmp(a1.getPointer(),a2.getPointer()<0));
}
template<class T>
ostream& operator<<(ostream& ostr,T& a)
{
return ostr<<a;
}
template<class T>
class MaxHeap
{
private:
int currentSize,maxSize;
T* heap;
public:
MaxHeap(int n)
{
currentSize=n;
heap=new T[n];
}
void initilize(T a,int size,int arraySize)
{
for(int j=1;j<=10;j++)
{
heap[j]=a[j];
cout<<heap[j];
}
currentSize=size;
maxSize=arraySize;
for(int i=currentSize/2;i>=1;i--)
{
T y=heap[i];
//cout<<"a "<<a[i]<<" y "<<y;
int c=2*(i);
//cout<<"c "<<c<<" current "<<currentSize<<endl;
while(c<=currentSize)
{
//cout<<"sub c "<<c<<endl;
if((c<currentSize) && (heap[c]<heap[c+1]))
c++;
if(y>=heap[c])
break;
heap[c/2]=heap[c];
c*=2;
}
heap[c/2]=y;
}
for(i=1;i<=10;i++)
{
cout<<heap[i]<<endl;
}
}
void print()
{
}
};
};
String1.h file:
using namespace std;
namespace bhadram1
{
class String
{
private:
char* _string;
int _size;
public:
String(int n=0);
String(String& s);
String(const char* );
String& operator=(String& s);
String& operator=(char* ch);
friend ostream& operator<<(ostream& ostr,String& s);
String operator+(String&);
String operator+(char* );
String& operator+=(String& s);
friend String operator+(const char* c,String& s);
//char& operator[](int n);
int operator<(String& s);
int operator>(String& s);
String& operator[](int n);
char* getPointer();
};
char* String::getPointer()
{
return _string;
}
String& String::operator =(char* ch)
{
int _size=strlen(ch);
_string=new char[_size+1];
for(int i=0;i<_size;i++)
{
_string[i]=*ch++;
}
_string[i]='\0';
return *this;
}
String& String::operator[](int n)
{
return *this;
}
int String::operator<(String& s)
{
return (strcmp(_string,s._string)<0);
}
int String::operator >(String& s)
{
return (strcmp(s._string,_string)>0);
}
/*char& String::operator [](int n)
{
return _string[n];
}*/
String operator+(const char* c,String& s)
{
String temp;
temp._size=strlen(c)+s._size;
strcpy(temp._string,c);
strcat(temp._string,s._string);
return temp;
}
String String::operator +(char* c)
{
String temp;
temp._size=_size+strlen(c);
strcpy(temp._string,_string);
strcat(temp._string,c);
return temp;
}
String& String::operator +=(String& s)
{
String temp;
temp._size=_size+s._size;
strcpy(temp._string,_string);
strcat(temp._string,s._string);
delete [] _string;
_size=temp._size;
_string=new char[temp._size+1];
strcpy(_string,temp._string);
return *this;
}
String String::operator+(String& s1)
{
String temp;
temp._size=_size+s1._size;
strcpy(temp._string,_string);
strcat(temp._string,s1._string);
return temp;
}
String& String::operator=(String& s)
{
_size=s._size;
delete [] _string;
_string=new char[_size+1];
for(int i=0;i<_size;i++)
_string[i]=s._string[i];
_string[i]='\0';
return *this;
}
String::String(int n)
{
_size=n;
_string=new char[_size+1];
for(int i=0;i<_size;i++)
_string[i]=' ';
_string[i]='\0';
}
String::String(String& s)
{
_size=s._size;
_string=new char[_size+1];
for(int i=0;i<_size;i++)
_string[i]=s._string[i];
_string[i]='\0';
}
String::String(const char* ch)
{
_size=strlen(ch);
_string=new char[_size+1];
for(int i=0;i<_size;i++)
_string[i]=*ch++;
_string[i]='\0';
}
ostream& operator<<(ostream& ostr,String& s)
{
return ostr<<s._string;
}
};
Thanking you,
yours friendly,
bhadram
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com |
|
From: Deepu d <dee...@ya...> - 2005-09-05 06:16:01
|
Dear sir, I am a newbie in Dev-C++. Can anybody please tell me how to configure I/O ports,especially serial ports using Dev-C++. Thanks in advance, Deepu D deepu d Mob:9895455879 ______________________________________________________ Click here to donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ |
|
From: Ilona N. <ilo...@ha...> - 2005-09-04 12:31:17
|
PrCiVa= UlMeAmCeLeViXa opallitrribileviagna eciaisumamdiaenbrextrarax $1 $3 $3 21.75.33 http://www.verbiatatis.= com through the door to the front hall. Look and see if all the coats are = heroine of Griboedovs Woe From Wit. It may have been this connection that |
|
From: Per W. <pw...@ia...> - 2005-09-04 10:01:57
|
Normally when asking questions, you should supply a bit more code and compiler error output to make the day a bit simpler for us. Anyway, when creating a template, you must have a space between the two > characters. Note that > is one C/C++ keyword, while >> is another, so if you forget the space in the template declaration, you will always get into trouble. In this case, the compiler is correct - your program is not correct. That is a quite common case. Just about _always_ the error is in the code, not in the compilers. Write like this: MaxHeap<Array<int> > m; /Per W On Sat, 3 Sep 2005, bhadram rao wrote: > Dear friends, > I need help. if i'm created template initialization like this its is not working in vc++ compiler. Program is correct but compiler is saying that there is no comma before m etc.. How to solve the problem. Please help me in giving the solution. > > Thanking you, > > yours sincerely, > bhadram |
|
From: bhadram r. <bha...@ya...> - 2005-09-04 06:38:09
|
Dear friends,
I need help. if i'm created template initialization like this its is not working in vc++ compiler. Program is correct but compiler is saying that there is no comma before m etc.. How to solve the problem. Please help me in giving the solution.
Thanking you,
yours sincerely,
bhadram
---------------------------------
Start your day with Yahoo! - make it your home page |
|
From: Robert A. <ral...@gm...> - 2005-09-03 19:42:20
|
Hello, If I understand what you are asking, the answer is that you can't using jus= t=20 C code. If we move the example into the literal word, lets say we have=20 papers in boxes. So now take your papers and boxes, you need to put them=20 somewhere, say the table. So now you need something that can take your=20 papers out of the boxes and do something with them. So how does that=20 'something' take the papers? It goes to the table and picks up the boxes or= =20 papers, but anything else can also go to the table and pickup the boxes or= =20 papers. So you really need to put some lock on the table so that ONLY your somethin= g=20 can touch the papers and boxes and not anything else, but that isn't=20 something that you can do do within your something. Now, you could have you= r=20 something '(en/de)crypt' the papers but that would only stop someone else's= =20 something from making scence of your papers but not changing them. Taking it back to your example, you may be able to take your files and=20 folders and put them under a 'user' so that ONLY that user can access them= =20 (using windows protection). They after your create your application, you ge= t=20 it blessed by the OS (windows) so that it runs as the user that can access= =20 your files and folders. Then only your code with be able to access the file= s=20 and folders, unless someone else gets their code to run as that user, etc..= . Hope this helps, Robert On 8/30/05, LETCHUMANAN SAMINADAN <arl...@ya...> wrote: >=20 > Dear all, > I would like to protect my files and folders using c source code. I don'= t=20 > want other users to change or delete my folders and files. I have tried= =20 > using Windows protection, but it doesn't work properly with c.=20 > I'm now trying to put my program in a Server directory and then create a= =20 > Shortcut icon on the desktop.If I try to execute my program from the=20 > Desktop, I can't do it. Because the folders all are blocked, and no=20 > permission at all. > That is the reason, I would like to protect my files and folders using c= =20 > source code and I don't want other users to change or delete my folders a= nd=20 > files. > Can anyone please help me on this matter. I really need your help. > Thank you, > Letchu... >=20 > ------------------------------ > Meet your soulmate! > *Yahoo! Asia presents Meetic*<http://us.rd.yahoo.com/prm/pers/mt/yma_sg/t= gl/*http://asia.yahoo.com/meetic>- where millions of singles gather=20 >=20 > |
|
From: Agathangelos C. <aga...@ca...> - 2005-09-03 12:47:37
|
CePrUlViX= aVaCiLeMeAm leoptragnalialviribi brexeciaamraxumistradiaen $3 $3&= nbsp;$1 33.75.21 http://www.premisitein= g.com glanced at her without moving an eyebrow. Thoughts raced, short, = incoherent and extraordinary: Im lost! ... |
|
From: SETRAZ <se...@ko...> - 2005-09-01 06:17:14
|
I have created a programme that draws a basic bitmap image in a window. Now I want to copy that into the clipboard for additional manipulation in another programme. When I use CreateCompatibleBitmap & SendMessage (...,WM_PRINT,...) & SetClipboardData to capture the window and copy it to the clipboard the clipboard contains all the buttons, and the window but no bitmaps. I have removed the PRF_ERASEBKGND and this does not fix the error. How do I capture the window including any bitmaps that I have displayed? Thanks in advance. |