dev-cpp-users Mailing List for Dev-C++ (Page 108)
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
|
|
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. |
|
From: Paul P. <P.P...@cu...> - 2005-08-31 01:21:55
|
I'm not sure I'd really call this a bug or just an annoyance, anyway I'm running ver 4.9.9.2 on Xp Pro ,if I add / delete a variable within a class it doesn't seem to appear / disappear in the class window until after I reload the project. Has anyone else seen this behaviour or do I have some obscure option set wrong somewhere? =20 Paul |
|
From: LETCHUMANAN S. <arl...@ya...> - 2005-08-30 04:25:00
|
Dear all, I would like to protect my files and folders using c source code. I don't want other users to change or delete my folders and files. I have tried using Windows protection, but it doesn't work properly with c. I'm now trying to put my program in a Server directory and then create a Shortcut icon on the desktop.If I try to execute my program from the Desktop, I can't do it. Because the folders all are blocked, and no permission at all. That is the reason, I would like to protect my files and folders using c source code and I don't want other users to change or delete my folders and files. Can anyone please help me on this matter. I really need your help. Thank you, Letchu... --------------------------------- Meet your soulmate! Yahoo! Asia presents Meetic - where millions of singles gather |
|
From: Ray K. <kul...@wr...> - 2005-08-30 01:49:29
|
I'm guessing the error message you're receiving is "syntax error before '/' token". If this is the case, go to project options (alt+p), click compiler tab, and disable the "Support all ANSI standard C Programs" item. // style comments were added with C99, and weren't in the original ANSI version. On Mon, 29 Aug 2005 15:50:18 -0700, "Richard Van Wyk" <ric...@ai...> wrote: > My Dev C++ is not recognising "//" comments. > I think it is broken. > Richard |
|
From: lordSauron <lor...@gm...> - 2005-08-30 01:42:10
|
Is that the only error? Many times one error will create others (many of which make you almost certain that the makers of the compiler were on drugs) that have almost no relation to the actual problem. |
|
From: lordSauron <lor...@gm...> - 2005-08-29 23:35:20
|
It could be that he's using C. I don't remember, but I thought that '//' was a C++ feature, and if he's using C, it might not work. |
|
From: Per W. <pw...@ia...> - 2005-08-29 22:49:04
|
Are you talking about syntax highlighting in the editor, or errors from the compiler when building the application? Is it a C or C++ source file? Have you specified any specific flags to the compiler, to specify language standard or similar? /Per W On Tue, 30 Aug 2005, Richard Van Wyk wrote: > My Dev C++ is not recognising "//" comments. > I think it is broken. > > > Richard > > |
|
From: Richard V. W. <ric...@ai...> - 2005-08-29 22:42:40
|
My Dev C++ is not recognising "//" comments. I think it is broken. Richard |
|
From: Per W. <pw...@ia...> - 2005-08-29 22:24:45
|
Remember that just about all drivers (most OS) are written in C (which is also the most common language for operating systems), so they are more or less normal code with the exception that they might have a bit more clutter because of synchronization, hot-plug etc. /Per W On Mon, 29 Aug 2005, Alfred P. Reaud wrote: > All true Per. Regardless my point was that low level IO isn't usually done in high level languages, and Google should be a powerful tool in the search for knowledge, especially at the instructional level. You seem to have taken umbrage, Per, when no offense was intended, or at least that is how I take the tone of your response. If that is the case, then my humble apologies. |
|
From: Alfred P. R. <al...@ya...> - 2005-08-29 21:04:36
|
All true Per. Regardless my point was that low level IO isn't usually done in high level languages, and Google should be a powerful tool in the search for knowledge, especially at the instructional level. You seem to have taken umbrage, Per, when no offense was intended, or at least that is how I take the tone of your response. If that is the case, then my humble apologies. Per Westermark <pw...@ia...> wrote: Security from snooping? That is done by strong encryption. <snip> Anyway, to be able to give reasonable help/recommendations it very much helps to know the why. A lot of people ask very specific questions about problems that are not relevant. What use is it to help them to fix a bug in an incorrectly chosen algorithm instead of telling them which algorithm they should have used? The quality of expected answers very much depends on the quality of the question. /Per W <snip> Alfred P. Reaud |
|
From: Per W. <pw...@ia...> - 2005-08-29 19:45:07
|
Security from snooping? That is done by strong encryption. Security from data loss? That is done by journaling or similar for power failures and mirrored or check-summed data to handle hardware failures. Data recovery? Journaling, ECC, check-sum, mirroring or similar.. Reasons for thinking about direct access - or for intercepting driver accesses might be: - extremely high-end database using custom-optimized file system. - cryptographic layer doing sector-by-sector encryption. - routing layer for faking a local harddrive over the network. - storage manager layer for glueing multiple drives dynamically or statically into larger drives. - software RAID. - support for foreign file systems natively or in "user mode". - repartitioning drives, growing/shrinking/converting file systems. - media rotation layer for supporting media with limited write counts. - repair of broken file system. - ... Most of above cases exists for free or almost free, or are so very out of scope for real use that it isn't economical to develop a solution unless the target application can be sold for _big_ sums of money. www.sysinternals.com have some nice articles about file systems and how to build your own disk defragger for example. Anyway, to be able to give reasonable help/recommendations it very much helps to know the why. A lot of people ask very specific questions about problems that are not relevant. What use is it to help them to fix a bug in an incorrectly chosen algorithm instead of telling them which algorithm they should have used? The quality of expected answers very much depends on the quality of the question. /Per W On Mon, 29 Aug 2005, Alfred P. Reaud wrote: > IMHO, there are many reasons for doing such, including security, data recovery, etc. However, I've never seen this done in C/C++. As you have to access low level IO functions, this is preferentially done is assembly, as I don't believe C/C++ have this capability. At least, I've never found the need to research it. > > I would recommend Googling for low level disk IO. If you're really diligent, you can find out that there are undocumented features to disk controllers that significantly enhance data security. > > Per Westermark <pw...@ia...> wrote: > Since reading/wringing directly to the drive requires access to the > physical hardware, I have to ask exactly why you have this need. What are > you trying to do? > > /Per W > > On Mon, 29 Aug 2005, rc...@bi... wrote: > > > > > Dear sir, > > > > I see how to read/write to files using C. But I need to to define a track/sector that I can read and write to it under my control. Could > > you help me pointing out documents/sites with this information or teatching me how to do this. > > > > Thanks for your help > > > > Roger > <snip> > > > > > Alfred P. Reaud > > > |
|
From: Alfred P. R. <al...@ya...> - 2005-08-29 19:06:37
|
IMHO, there are many reasons for doing such, including security, data recovery, etc. However, I've never seen this done in C/C++. As you have to access low level IO functions, this is preferentially done is assembly, as I don't believe C/C++ have this capability. At least, I've never found the need to research it. I would recommend Googling for low level disk IO. If you're really diligent, you can find out that there are undocumented features to disk controllers that significantly enhance data security. Per Westermark <pw...@ia...> wrote: Since reading/wringing directly to the drive requires access to the physical hardware, I have to ask exactly why you have this need. What are you trying to do? /Per W On Mon, 29 Aug 2005, rc...@bi... wrote: > > Dear sir, > > I see how to read/write to files using C. But I need to to define a track/sector that I can read and write to it under my control. Could > you help me pointing out documents/sites with this information or teatching me how to do this. > > Thanks for your help > > Roger <snip> Alfred P. Reaud |
|
From: Per W. <pw...@ia...> - 2005-08-29 18:19:13
|
Since reading/wringing directly to the drive requires access to the physical hardware, I have to ask exactly why you have this need. What are you trying to do? /Per W On Mon, 29 Aug 2005, rc...@bi... wrote: > > Dear sir, > > I see how to read/write to files using C. But I need to to define a track= /sector that I can read and write to it under my control. Could > you help me pointing out=A0documents/sites with this information or teatc= hing me how to do this. > > Thanks for your help > > Roger > > ------------------------------------------------------- SF.Net email is S= ponsored by the Better Software Conference & EXPO September > 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile &= Plan-Driven Development * Managing Projects & Teams * Testing & > QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce= 5sf _______________________________________________ > Dev-cpp-users mailing list Dev...@li... TO UNSUBSC= RIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: <rc...@bi...> - 2005-08-29 15:55:27
|
<p>Dear sir,</p><p /><p style="">I see how to read/write to files using C. But I need to to define a track/sector that I can read and write to it under my control. Could you help me pointing out documents/sites with this information or teatching me how to do this.</p><p /><p>Thanks for your help</p><p /><p style="">Roger</p> |
|
From: rubberchickensarefunny <rub...@ya...> - 2005-08-28 18:15:10
|
trying the following code to test SQL connection to MS SQL server using machine DNS name.
receivng errors:
[linker error] undefined reference to 'SQLAllocEnv@4'
[linker error] undefined reference to 'SQLAllocConnect@8'
(etc. for all SQL function calls in the code)
using Dev-C++ 4.9.9.2 and the latest mingw WindowsAPI package (where the sql header files are)
I've found others who have had the same problem, but no solution - going nuts!
test code:
#include <windows.h>
#include <sqlext.h>
#include <cstdlib>
#include <iostream>
int main(int argc, char *argv[])
{
HENV hEnv = NULL; // Env Handle from SQLAllocEnv()
HDBC hDBC = NULL; // Connection handle
HSTMT hStmt = NULL;// Statement handle
UCHAR szDSN[SQL_MAX_DSN_LENGTH] = "mydsn";// Data Source Name buffer
UCHAR szUID[13] = "username";// User ID buffer
UCHAR szPasswd[7] = "passwd";// Password buffer
UCHAR szModel[128];// Model buffer
SDWORD cbModel;// Model buffer bytes recieved
UCHAR szSqlStr[128]= "SELECT test FROM testtable where test = 'test_success'";
RETCODE retcode;
// Allocate memory for ODBC Environment handle
SQLAllocEnv (&hEnv);
// Allocate memory for the connection handle
SQLAllocConnect (hEnv, &hDBC);
// Connect to the data source "szDSN" using userid and password.
retcode = SQLConnect (hDBC, szDSN, SQL_NTS, szUID, SQL_NTS, szPasswd, SQL_NTS);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
{
// Allocate memory for the statement handle
retcode = SQLAllocStmt (hDBC, &hStmt);
// Prepare the SQL statement by assigning it to the statement handle
retcode = SQLPrepare (hStmt, szSqlStr, sizeof (szSqlStr));
// Execute the SQL statement handle
retcode = SQLExecute (hStmt);
// Project only column 1 which is the models
SQLBindCol (hStmt, 1, SQL_C_CHAR, szModel, sizeof(szModel), &cbModel);
// Get row of data from the result set defined above in the statement
retcode = SQLFetch (hStmt);
// Free the allocated statement handle
SQLFreeStmt (hStmt, SQL_DROP);
// Disconnect from datasource
SQLDisconnect (hDBC);
}
std::cout << retcode << "\n";
// Free the allocated connection handle
SQLFreeConnect (hDBC);
// Free the allocated ODBC environment handle
SQLFreeEnv (hEnv);
system("PAUSE");
return EXIT_SUCCESS;
}
---------------------------------
Start your day with Yahoo! - make it your home page |
|
From: <m....@ho...> - 2005-08-28 17:10:00
|
Hi! =20 Just tiies to install Dev-C++ v 4.9.9.2 at my homecomputer, but = something is wrong... =20 The installation complets without problems, but when I try i use Dev-C++ = the problem starts.... =20 I then opens a exampleproject like "Jackpot" and then tries to compile. But when I do this I get an error in the Compile Log that says something about "No such file or directory" ?!?! =20 I tried to copy and paste the logmessage but it dosen't work :-((( I have installed Dev-C++ at many other computers without any problems, = so this is most disturbing for me. =20 Any ideas anybody??? =20 |
|
From: David M. <dml...@co...> - 2005-08-28 16:28:38
|
Have you checked for foo.exe in the same directory as foo.cpp? Have you tried hitting the execute button (the one that looks like a console window right next to the compile button)? As long as you don't see any error messages then the compilation went fine. The line "execution terminated" is simply telling you that the compiler is done and either you have some errors to fix or you code is ready to run. lordSauron wrote: >On 8/27/05, neo...@fu... <neo...@fu...> wrote: > > >>Whenever I attempt to compile a .cpp, even a single, self-contained .cpp file, I get this in the compiler log: >> >> > > > >>Compiler: Default compiler >>Executing g++.exe... >>g++.exe "foo.cpp" -o "foo.exe" >>Execution terminated >> >> > >What's it doing executing? I don't understand that. > > > >>I'm on Windows XP, though I've recently. How can I fix this? Am I doing something wrong? I've used other compilers before without issue on other machines... but I'm looking for one to work on for personal projects. >> >> > >Want to know a big secret? GCC is really one of the better C/C++ >compilers around. My dad, whose a defense contractor for the US DoD, >when they have something that they either can't get to run fast enough >on their expensive Microsoft and Borland compilers, use the G++, and >usually get far better performance and reliability. G++ is really >nice in that it's free, the best there is, and is so scalable that >it'll work like a charm for everything from helloworld.c to >missle_defense_algorithm.cpp and everything in between. > >As for your error, to me it sounds like you made files but no project. > DevC++ is odd in this manner. When you create a project, it keeps a >list of all the files it needs to send during compile. If you're not >developing with a project, you need to make one and add the files to >it. However, you were really vauge, so I could very easily be miles >from the truth of your problem. Good luck though > > |
|
From: lordSauron <lor...@gm...> - 2005-08-27 23:50:23
|
On 8/27/05, neo...@fu... <neo...@fu...> wrote: > Whenever I attempt to compile a .cpp, even a single, self-contained .cpp = file, I get this in the compiler log: > Compiler: Default compiler > Executing g++.exe... > g++.exe "foo.cpp" -o "foo.exe" > Execution terminated What's it doing executing? I don't understand that. > I'm on Windows XP, though I've recently. How can I fix this? Am I doing s= omething wrong? I've used other compilers before without issue on other mac= hines... but I'm looking for one to work on for personal projects. Want to know a big secret? GCC is really one of the better C/C++ compilers around. My dad, whose a defense contractor for the US DoD, when they have something that they either can't get to run fast enough on their expensive Microsoft and Borland compilers, use the G++, and usually get far better performance and reliability. G++ is really nice in that it's free, the best there is, and is so scalable that it'll work like a charm for everything from helloworld.c to missle_defense_algorithm.cpp and everything in between. As for your error, to me it sounds like you made files but no project. DevC++ is odd in this manner. When you create a project, it keeps a list of all the files it needs to send during compile. If you're not developing with a project, you need to make one and add the files to it. However, you were really vauge, so I could very easily be miles from the truth of your problem. Good luck though! |