dev-cpp-users Mailing List for Dev-C++ (Page 699)
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: Bolek V. <vr...@pa...> - 2001-05-09 11:21:23
|
Just testing the list works - I did not get any message for several
days.
--
============================================================
Ing. Boleslav Vrany
Stanice techniku DDM hl. m. Prahy
Pod Juliskou 2a
Praha 6 - Dejvice
16000
Czech Republic
tel. (420 2) 243 10 240
|
|
From: Andre` N. C. <ca...@op...> - 2001-05-07 11:31:50
|
----- Original Message -----
From: "gisan" <gi...@li...>
To: <dev...@li...>
Sent: Monday, May 07, 2001 5:38 AM
Subject: Re: [Dev-C++] (no subject)
>
>
> do
> {
>
> cout<< "please enter the width of tree";
> cin>> g ;
>
>
> if(g <=10)
>
.........................................................>
> will take into account the number of times the loop has been
I'm not sure what you mean here but if you want to keep track of howmany
times the loop is hit you could add
ulLoopCount = ++ above
cout<< "please enter the width of tree";
of course make sure you initialize it to 0 first.
|
|
From: gisan <gi...@li...> - 2001-05-07 09:51:41
|
#include <iomanip.h>
#include <iostream.h>
#include <stdlib.h>
const int removal= 500;
const int trimming= 80;
int main()
{
int r;
int g;
int t;
float cost;
char choice= 'y';
char more_grinding;
float total;
do
{
cout<< "please enter the width of tree";
cin>> g ;
if(g <=10)
{
cost = 25;
cout << cost;
}
else if(g >10)
{
cost = (g - 10) * 2 + 25;
cout<< cost;
}
cout << "anymore grinding...? <y> or <n>";
cin >> choice;
}
while (choice == 'y');
total= cost + cost+ cost +cost +cost+cost;
cout<< "total is....";
cout<< total;
system ("pause");
return 0;
}
please, please please, could some genius help me with this pathetic
problem,
how cn i modify this code so that when i compute the total cost the
subtotal
will take into account the number of times the loop has been
entered(remebering the cost) and adding each cost,
ie) i want to compute a subtotal
how can i write code to the following
given x amount of integers print the largest
how can i use char (n) to write a test program that allows me to see
the
characters contained within my characterset in my computer
from a confused programmer,
thanx for your precious time and patience in advance.
lostboyz
|
|
From: Colin W. <col...@at...> - 2001-05-07 05:29:56
|
Guys, Having a problem generating a DLL - and it is driving me nuts. Would appreciate any assistance you may be able to offer. I am exporting 7 or 8 very similar functions in a single DLL - 6 of the 8 work perfectly. However, the function addresses are not resolved (at run-time) for the other two. I am getting the following spurious message from the linker. "ndlltool: Syntax error in def file C:\DOCUME~1\COLINW~1\LOCALS~1\Temp\cca01924.def:39 ndlltool: Syntax error in def file C:\DOCUME~1\COLINW~1\LOCALS~1\Temp\cca01924.def:39 Warning: no export definition file provided dllwrap will create one, but may not be what you want" And indeed the two function names do not appear in the .DEF file. I am a neophyte in this area and any input on DLL function exporting and .DEF files would add to my lack of knowledge. Even a pointer to an appropriate web site would be useful. Many Thanks, Colin Woods. |
|
From: Jasbir C. <cha...@ya...> - 2001-05-06 21:17:10
|
I am trying to learn how to make dll in Dev-C++. My Program is as follows:
#include <windows.h>
#include <stdio.h>
#include <string.h>
#define DllExport extern "C" __declspec (dllexport)
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason,
LPVOID reserved /* Not used. */ );
/* DllMain Results:
TRUE on success, FALSE on failure. */
BOOL APIENTRY
DllMain (
HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}
DllExport void ShowMouseLoc(HDC hdc, LPARAM lParam)
{
char str[80];
wsprintf(str, "Button is down at %d, %d",
LOWORD(lParam), HIWORD(lParam));
TextOut(hdc, LOWORD(lParam), HIWORD(lParam),
str, strlen(str));
}
When I compile it gives me following linker errors:
f:codelocalschildtswin98chap21 ewmydll.o(.text+0x93):mydll.cpp: undefined reference to `TextOutA@20'
Warning: no export definition file provided
dllwrap will create one, but may not be what you want
F:DEV-C_~1BINdllwrap: gcc exited with status 1
If I take out TextOut line it makes dll and lib file without any error? I don't know what I am doing wrong. I would like to know what more I have to insert in the program so that linker see the TextOut statement.
Jasbir Chauhan
---------------------------------
Do You Yahoo!?
Yahoo! Auctions - Click and bid on cool stuff like Dave Matthews Band Tickets & more! |
|
From: <LO5...@ao...> - 2001-05-06 21:01:38
|
#include <iomanip.h>
#include <iostream.h>
#include <stdlib.h>
const int removal= 500;
const int trimming= 80;
int main()
{
int r;
int g;
int t;
float cost;
char choice= 'y';
char more_grinding;
float total;
do
{
cout<< "please enter the width of tree";
cin>> g ;
if(g <=10)
{
cost = 25;
cout << cost;
}
else if(g >10)
{
cost = (g - 10) * 2 + 25;
cout<< cost;
}
cout << "anymore grinding...? <y> or <n>";
cin >> choice;
}
while (choice == 'y');
total= cost + cost+ cost +cost +cost+cost;
cout<< "total is....";
cout<< total;
system ("pause");
return 0;
}
please, please please, could some genius help me with this pathetic problem,
how cn i modify this code so that when i compute the total cost the subtotal
will take into account the number of times the loop has been
entered(remebering the cost) and adding each cost,
ie) i want to compute a subtotal
how can i write code to the following
given x amount of integers print the largest
how can i use char (n) to write a test program that allows me to see the
characters contained within my characterset in my computer
from a confused programmer,
thanx for your precious time and patience in advance.
lostboyz
|
|
From: Luigi S. <gi...@li...> - 2001-05-05 22:43:32
|
Try this version of "charsdelete".
I assume: i) sequence is null terminated, ii) current_length is the
number of chars in sequence (i.e. if sequence is "delete the extra
word word." current_length is 27).
bool String::charsdelete (int begin, int end)
{
if (begin < 0 || begin >= current_length || end >= current_length
|| begin > end)
return false;
int partdeleted = end - begin + 1;
while (end < current_length) // moves also the trailing '\0'
sequence[begin++] = sequence[++end];
current_length -= partdeleted;
allocated -= partdeleted; // I wonder why you keep track of
allocated memory
return true;
}
gisan
----- Original Message -----
From: "Michael Potter" <mdp...@ya...>
To: <dev...@li...>
Sent: Wednesday, May 02, 2001 3:53 PM
Subject: Re: [Dev-C++] String Functions
The caller should have some way to detect the case. My
function returned a '-1' in this case. The caller
should test for this result.
--- Linda Hohenstein <lz...@sp...> wrote:
> Thanks Michael and Kurt!
>
> Michael, is this:
>
> "You also don't handle the case where
> the character does not exist."
>
> left to the user to take care of?
>
> TIA,
>
> Linda
>
> -----------------------------------------
> ----- Original Message -----
> From: "Michael Potter" <mdp...@ya...>
> To: <dev...@li...>
> Sent: Tuesday, May 01, 2001 5:02 PM
> Subject: Re: [Dev-C++] String Functions
>
>
> > Sorry, none of this was tested but, it may give
> you a
> > hand.
> >
> > 1) You do not terminate the loop once you find the
> > first instance. You also don't handle the case
> where
> > the character does not exist. TRY:
> >
> > int String::firstcharfind (const char& charfind)
> const
> > //#2
> > {
> > int i;
> > for (i = 0; i < current_length; i++)
> > {
> > if (sequence[i] == charfind)
> > return i;
> > }
> > return -1;
> > }
> >
> > 2) I am assuming your string arrays are NULL
> > terminiated.
> > TRY:
> >
> > bool String::charsdelete (int begin, int end)
> //#4
> > {
> > if ((begin < 0) ||
> > (begin >= current_length) ||
> > (end >= current_length) ||
> > (begin > end)
> > return false;
> >
> > int lengthToMove = (current_length - end);
> >
> >
> >
>
memcpy(&sequence[begin],&sequence[end+1],lengthToMove);
> >
> > current_length = current_length - ((end - begin) +
> > 1);
> >
> > return true;
> > }
> >
> >
> >
> >
> >
> >
> > --- Linda Hohenstein <lz...@sp...> wrote:
> > > Hi All,
> > >
> > > Can anyone help me with a couple of functions I
> am
> > > having problems with in the String class I am
> > > writing? (It runs.)
> > >
> > > The following code is supposed to return the
> first
> > > instance of a character, but is returning the
> last
> > > (11):
> > >
> > > int String::firstcharfind (const char& charfind)
> > > const //#2
> > > { size_t i;
> > > int position;
> > > for (i = 0; i < current_length; i++)
> > > {
> > > if (sequence[i] == charfind)
> > > position = i;
> > > }
> > > return position;
> > > }
> > >
> > > This is called by:
> > >
> > > //#2
> > > char testing [28] = "Delete the extra word
> > > word.";
> > > String demostring (testing);
> > > cout << demostring.firstcharfind ('e') <<
> endl;
> > >
> > > The second function is supposed to delete one of
> the
> > > "word"s in the above function:
> > >
> > > bool String::charsdelete (int begin, int end)
> //#4
> > > {
> > > int i;
> > > if ((begin < 0) || (end > current_length) ||
> > > (begin > end))
> > > return false;
> > > int partdeleted = (end - begin) + 1;
> > > for (i = begin; i <= current_length -
> partdeleted
> > > ; i++)
> > > {
> > > sequence[i] = sequence[partdeleted + 1];
> > > }
> > > current_length = current_length -
> partdeleted;
> > > allocated = allocated - partdeleted;
> > > return true;
> > > }
> > >
> > > It's called by:
> > >
> > > //#4
> > > demostring.charsdelete (18, 22);
> > > cout << demostring << endl;
> > >
> > > The output is:
> > >
> > > Delete the extra w ord.
> > >
> > > I'd appreciate any help anyone can give - it's
> the
> > > last class for my Data Structures class.
> > >
> > > TIA,
> > >
> > > Linda
> > >
> > >
> > >
> > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Auctions - buy the things you want at great
> prices
> > http://auctions.yahoo.com/
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> >
>
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
>
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Michael P. <mdp...@ya...> - 2001-05-02 13:53:56
|
The caller should have some way to detect the case. My
function returned a '-1' in this case. The caller
should test for this result.
--- Linda Hohenstein <lz...@sp...> wrote:
> Thanks Michael and Kurt!
>
> Michael, is this:
>
> "You also don't handle the case where
> the character does not exist."
>
> left to the user to take care of?
>
> TIA,
>
> Linda
>
> -----------------------------------------
> ----- Original Message -----
> From: "Michael Potter" <mdp...@ya...>
> To: <dev...@li...>
> Sent: Tuesday, May 01, 2001 5:02 PM
> Subject: Re: [Dev-C++] String Functions
>
>
> > Sorry, none of this was tested but, it may give
> you a
> > hand.
> >
> > 1) You do not terminate the loop once you find the
> > first instance. You also don't handle the case
> where
> > the character does not exist. TRY:
> >
> > int String::firstcharfind (const char& charfind)
> const
> > //#2
> > {
> > int i;
> > for (i = 0; i < current_length; i++)
> > {
> > if (sequence[i] == charfind)
> > return i;
> > }
> > return -1;
> > }
> >
> > 2) I am assuming your string arrays are NULL
> > terminiated.
> > TRY:
> >
> > bool String::charsdelete (int begin, int end)
> //#4
> > {
> > if ((begin < 0) ||
> > (begin >= current_length) ||
> > (end >= current_length) ||
> > (begin > end)
> > return false;
> >
> > int lengthToMove = (current_length - end);
> >
> >
> >
>
memcpy(&sequence[begin],&sequence[end+1],lengthToMove);
> >
> > current_length = current_length - ((end - begin) +
> > 1);
> >
> > return true;
> > }
> >
> >
> >
> >
> >
> >
> > --- Linda Hohenstein <lz...@sp...> wrote:
> > > Hi All,
> > >
> > > Can anyone help me with a couple of functions I
> am
> > > having problems with in the String class I am
> > > writing? (It runs.)
> > >
> > > The following code is supposed to return the
> first
> > > instance of a character, but is returning the
> last
> > > (11):
> > >
> > > int String::firstcharfind (const char& charfind)
> > > const //#2
> > > { size_t i;
> > > int position;
> > > for (i = 0; i < current_length; i++)
> > > {
> > > if (sequence[i] == charfind)
> > > position = i;
> > > }
> > > return position;
> > > }
> > >
> > > This is called by:
> > >
> > > //#2
> > > char testing [28] = "Delete the extra word
> > > word.";
> > > String demostring (testing);
> > > cout << demostring.firstcharfind ('e') <<
> endl;
> > >
> > > The second function is supposed to delete one of
> the
> > > "word"s in the above function:
> > >
> > > bool String::charsdelete (int begin, int end)
> //#4
> > > {
> > > int i;
> > > if ((begin < 0) || (end > current_length) ||
> > > (begin > end))
> > > return false;
> > > int partdeleted = (end - begin) + 1;
> > > for (i = begin; i <= current_length -
> partdeleted
> > > ; i++)
> > > {
> > > sequence[i] = sequence[partdeleted + 1];
> > > }
> > > current_length = current_length -
> partdeleted;
> > > allocated = allocated - partdeleted;
> > > return true;
> > > }
> > >
> > > It's called by:
> > >
> > > //#4
> > > demostring.charsdelete (18, 22);
> > > cout << demostring << endl;
> > >
> > > The output is:
> > >
> > > Delete the extra w ord.
> > >
> > > I'd appreciate any help anyone can give - it's
> the
> > > last class for my Data Structures class.
> > >
> > > TIA,
> > >
> > > Linda
> > >
> > >
> > >
> > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Auctions - buy the things you want at great
> prices
> > http://auctions.yahoo.com/
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> >
>
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
>
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
|
|
From: Mikael A. <mik...@ma...> - 2001-05-02 07:27:51
|
Hi ! Does Dev-Cpp support other file types then .h/.c/.cpp, like for example flex/lex (.l) and yacc/bison (.y) or do I have to compile these outside Dev-Cpp and then put the produced source files in the project ? Mikael |
|
From: Linda H. <lz...@sp...> - 2001-05-01 23:01:50
|
Thanks Michael and Kurt!
Michael, is this:
"You also don't handle the case where
the character does not exist."
left to the user to take care of?
TIA,
Linda
-----------------------------------------
----- Original Message -----
From: "Michael Potter" <mdp...@ya...>
To: <dev...@li...>
Sent: Tuesday, May 01, 2001 5:02 PM
Subject: Re: [Dev-C++] String Functions
> Sorry, none of this was tested but, it may give you a
> hand.
>
> 1) You do not terminate the loop once you find the
> first instance. You also don't handle the case where
> the character does not exist. TRY:
>
> int String::firstcharfind (const char& charfind) const
> //#2
> {
> int i;
> for (i = 0; i < current_length; i++)
> {
> if (sequence[i] == charfind)
> return i;
> }
> return -1;
> }
>
> 2) I am assuming your string arrays are NULL
> terminiated.
> TRY:
>
> bool String::charsdelete (int begin, int end) //#4
> {
> if ((begin < 0) ||
> (begin >= current_length) ||
> (end >= current_length) ||
> (begin > end)
> return false;
>
> int lengthToMove = (current_length - end);
>
>
> memcpy(&sequence[begin],&sequence[end+1],lengthToMove);
>
> current_length = current_length - ((end - begin) +
> 1);
>
> return true;
> }
>
>
>
>
>
>
> --- Linda Hohenstein <lz...@sp...> wrote:
> > Hi All,
> >
> > Can anyone help me with a couple of functions I am
> > having problems with in the String class I am
> > writing? (It runs.)
> >
> > The following code is supposed to return the first
> > instance of a character, but is returning the last
> > (11):
> >
> > int String::firstcharfind (const char& charfind)
> > const //#2
> > { size_t i;
> > int position;
> > for (i = 0; i < current_length; i++)
> > {
> > if (sequence[i] == charfind)
> > position = i;
> > }
> > return position;
> > }
> >
> > This is called by:
> >
> > //#2
> > char testing [28] = "Delete the extra word
> > word.";
> > String demostring (testing);
> > cout << demostring.firstcharfind ('e') << endl;
> >
> > The second function is supposed to delete one of the
> > "word"s in the above function:
> >
> > bool String::charsdelete (int begin, int end) //#4
> > {
> > int i;
> > if ((begin < 0) || (end > current_length) ||
> > (begin > end))
> > return false;
> > int partdeleted = (end - begin) + 1;
> > for (i = begin; i <= current_length - partdeleted
> > ; i++)
> > {
> > sequence[i] = sequence[partdeleted + 1];
> > }
> > current_length = current_length - partdeleted;
> > allocated = allocated - partdeleted;
> > return true;
> > }
> >
> > It's called by:
> >
> > //#4
> > demostring.charsdelete (18, 22);
> > cout << demostring << endl;
> >
> > The output is:
> >
> > Delete the extra w ord.
> >
> > I'd appreciate any help anyone can give - it's the
> > last class for my Data Structures class.
> >
> > TIA,
> >
> > Linda
> >
> >
> >
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Mikael A. <mik...@ma...> - 2001-05-01 22:55:27
|
Hi ! I could not find any info on the source code editor in the help ?, where can I find info about what keys does what in the editor, I guess I looked in the wrong place...;-) Mikael |
|
From: Schedler, K. <Kur...@hi...> - 2001-05-01 21:45:28
|
bool String::deleteChars (int beg, int end)
{
// do range checking on arguments
...
// assuming a null terminated string...
// overwrite the characters from beg onward
// with the characters from end onward
while ( sequence[end] != '\0' )
{
sequence[beg] = sequence[end];
beg++;
end++;
}
sequence[beg] = '\0';
current_length = beg;
return true;
}
-----Original Message-----
From: Linda Hohenstein [mailto:lz...@sp...]
Sent: Tuesday, May 01, 2001 1:28 PM
To: Tutoraid; C++ List
Subject: [Dev-C++] String Functions
Hi All,
Can anyone help me with a couple of functions I am having problems with in
the String class I am writing? (It runs.)
The following code is supposed to return the first instance of a character,
but is returning the last (11):
int String::firstcharfind (const char& charfind) const //#2
{ size_t i;
int position;
for (i = 0; i < current_length; i++)
{
if (sequence[i] == charfind)
position = i;
}
return position;
}
This is called by:
//#2
char testing [28] = "Delete the extra word word.";
String demostring (testing);
cout << demostring.firstcharfind ('e') << endl;
The second function is supposed to delete one of the "word"s in the above
function:
bool String::charsdelete (int begin, int end) //#4
{
int i;
if ((begin < 0) || (end > current_length) || (begin > end))
return false;
int partdeleted = (end - begin) + 1;
for (i = begin; i <= current_length - partdeleted ; i++)
{
sequence[i] = sequence[partdeleted + 1];
}
current_length = current_length - partdeleted;
allocated = allocated - partdeleted;
return true;
}
It's called by:
//#4 <file://#4>
demostring.charsdelete (18, 22);
cout << demostring << endl;
The output is:
Delete the extra w ord.
I'd appreciate any help anyone can give - it's the last class for my Data
Structures class.
TIA,
Linda
"The sender believes that this E-mail and any attachments were free of any
virus, worm, Trojan horse, and/or malicious code when sent. This message
and its attachments could have been infected during transmission. By
reading the message and opening any attachments, the recipient accepts full
responsibility for taking protective and remedial action about viruses and
other defects. The sender's employer is not liable for any loss or damage
arising in any way from this message or its attachments."
|
|
From: Michael P. <mdp...@ya...> - 2001-05-01 21:02:38
|
Sorry, none of this was tested but, it may give you a
hand.
1) You do not terminate the loop once you find the
first instance. You also don't handle the case where
the character does not exist. TRY:
int String::firstcharfind (const char& charfind) const
//#2
{
int i;
for (i = 0; i < current_length; i++)
{
if (sequence[i] == charfind)
return i;
}
return -1;
}
2) I am assuming your string arrays are NULL
terminiated.
TRY:
bool String::charsdelete (int begin, int end) //#4
{
if ((begin < 0) ||
(begin >= current_length) ||
(end >= current_length) ||
(begin > end)
return false;
int lengthToMove = (current_length - end);
memcpy(&sequence[begin],&sequence[end+1],lengthToMove);
current_length = current_length - ((end - begin) +
1);
return true;
}
--- Linda Hohenstein <lz...@sp...> wrote:
> Hi All,
>
> Can anyone help me with a couple of functions I am
> having problems with in the String class I am
> writing? (It runs.)
>
> The following code is supposed to return the first
> instance of a character, but is returning the last
> (11):
>
> int String::firstcharfind (const char& charfind)
> const //#2
> { size_t i;
> int position;
> for (i = 0; i < current_length; i++)
> {
> if (sequence[i] == charfind)
> position = i;
> }
> return position;
> }
>
> This is called by:
>
> //#2
> char testing [28] = "Delete the extra word
> word.";
> String demostring (testing);
> cout << demostring.firstcharfind ('e') << endl;
>
> The second function is supposed to delete one of the
> "word"s in the above function:
>
> bool String::charsdelete (int begin, int end) //#4
> {
> int i;
> if ((begin < 0) || (end > current_length) ||
> (begin > end))
> return false;
> int partdeleted = (end - begin) + 1;
> for (i = begin; i <= current_length - partdeleted
> ; i++)
> {
> sequence[i] = sequence[partdeleted + 1];
> }
> current_length = current_length - partdeleted;
> allocated = allocated - partdeleted;
> return true;
> }
>
> It's called by:
>
> //#4
> demostring.charsdelete (18, 22);
> cout << demostring << endl;
>
> The output is:
>
> Delete the extra w ord.
>
> I'd appreciate any help anyone can give - it's the
> last class for my Data Structures class.
>
> TIA,
>
> Linda
>
>
>
>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
|
|
From: Linda H. <lz...@sp...> - 2001-05-01 20:28:39
|
Hi All,
Can anyone help me with a couple of functions I am having problems with =
in the String class I am writing? (It runs.)
The following code is supposed to return the first instance of a =
character, but is returning the last (11):
int String::firstcharfind (const char& charfind) const //#2
{ size_t i;
int position;
for (i =3D 0; i < current_length; i++)
{
if (sequence[i] =3D=3D charfind)
position =3D i;
}
return position;
}
This is called by:=20
//#2
char testing [28] =3D "Delete the extra word word.";
String demostring (testing);
cout << demostring.firstcharfind ('e') << endl;
The second function is supposed to delete one of the "word"s in the =
above function:
bool String::charsdelete (int begin, int end) //#4
{
int i;
if ((begin < 0) || (end > current_length) || (begin > end))
return false;
int partdeleted =3D (end - begin) + 1;
for (i =3D begin; i <=3D current_length - partdeleted ; i++)
{
sequence[i] =3D sequence[partdeleted + 1];
}
current_length =3D current_length - partdeleted;
allocated =3D allocated - partdeleted;
return true;
}
It's called by:
//#4
demostring.charsdelete (18, 22);
cout << demostring << endl;
The output is:
Delete the extra w ord.
I'd appreciate any help anyone can give - it's the last class for my =
Data Structures class.
TIA,
Linda
|
|
From: Jared E. <ja...@vo...> - 2001-04-28 01:50:28
|
Try reading the system clock. Set a timer to go at given time. At 08:28 PM 4/26/2001 -0700, you wrote: >HElLo there peoples. i want to bug my friend by >writing a program that displays a message box at a >certin time in the day, every hour or at any time. I >know that some viruses are executed at certin times >but i can insure you that i will not use the code for >malicious purposes. Can anyone help =)? ThanX > > -PrOgRaMmInG LoSeR > >__________________________________________________ >Do You Yahoo!? >Yahoo! Auctions - buy the things you want at great prices >http://auctions.yahoo.com/ > >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >http://lists.sourceforge.net/lists/listinfo/dev-cpp-users 'Any given program, when running correctly, is obsolete.' - First Law of Computer Programming |
|
From: <fle...@ya...> - 2001-04-27 08:01:48
|
just to confirm it to you, what you want to write IS a virus. if you intend your program to be executed in dos/prompt mode you will have to include some ASM in you c code to first modifie the specific sys interupts and make the program finish as a TSR(terminate and stay resident) other wise, if the program is for windows and you don't want your friend to know that it is running (eg. in the startbar or as a system icon in the tray) you will still probably have to interfear with system interupts but also make a call to a program that will be a windows app. caution. any anti-virus on you friends machine will see your program as a virus and remove it and reconfigure your systems interupt table. the other problem is how to load the program on boot. for this you could just put the name in the autoexec(not very well camaflaged) or change your systems boot sector. whatever you would like to do you are looking at a lot of work for a joke. i know that this is mainly theoretical advice but i hope it will help if you still fancy the idea and come across problems with the ASM please send me a mail and i will try to help as much as pos. tim ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie |
|
From: i_suck _. <pro...@ya...> - 2001-04-27 03:28:51
|
HElLo there peoples. i want to bug my friend by writing a program that displays a message box at a certin time in the day, every hour or at any time. I know that some viruses are executed at certin times but i can insure you that i will not use the code for malicious purposes. Can anyone help =)? ThanX -PrOgRaMmInG LoSeR __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ |
|
From: Bolek V. <vr...@pa...> - 2001-04-26 20:12:48
|
I had written a non-overlapped serial communication in C++ some time
ago. It uses Win32 API, but it didn't work under Dev-CPP 4.0. It works
under Borland's free C++ compiler 5.5. I guess there is an error in
Dev-CPP (or in my code? - I just read the Win32 API help from Microsoft
and wrote something). It will hang at somewhere at GetCommState in open(
) under DevCPP 4.
I send it to you. It is a part of a much greater work that controls a
scientific device. The device can be controlled with serial port or GPIB
- that's why I created an abstract class TCommunicator. Just changing
the communicator used from TSerialComm to TGPIBComm will make the
program use GPIB instead of serial.
The device reads a command, obeys it and sends a response. The response
always ends with a special char - the end char. No end char means the
response didn't come. So I wait for it to come and then read the
response.
comm->send( ....);
comm->wait( ....);
comm->read( ....);
That's how I use it. TNessyException is a special class of exceptions
defined in the program and errCommError and errMemory mean an error in
communication or error in memory allocation occured. id is device id -
forget it.
The WinAPI functions used are explained in the Microsoft's Win32 API
help file. I think you can download it at Dev-CPP's web site.
--
============================================================
Ing. Boleslav Vrany
Stanice techniku DDM hl. m. Prahy
Pod Juliskou 2a
Praha 6 - Dejvice
16000
Czech Republic
tel. (420 2) 243 10 240 |
|
From: Lorenzo <co...@in...> - 2001-04-26 09:33:17
|
You can get microsoft dialog editor from microsoft web site, but i don't remember the exact location. |
|
From: Yeoh H. <ye...@ya...> - 2001-04-26 01:38:02
|
You might want to look at this sample code from Planet Source Code It uses Win32 API functions to access the comm ports. Class for serial port access under Windows NT. http://www.planet-source-code.com/xq/ASP/txtCodeId.677/lngWId.3/qx/vb/script s/ShowCode.htm Yeoh ----- Original Message ----- From: Alex Cosic <al...@ca...> To: <dev...@li...> Sent: Thursday, April 26, 2001 9:23 AM Subject: RE: [Dev-C++] Serial Communication > Thank for info.I understand that but: > > Direct hardware access in 32-bit Windows is generally not allowed. While it > can be done in the Win9x OS by using inline assembly, this is generally > discouraged as this technique is not supported under WinNT. The hardware > port communication family of functions, such as inportb, inpw, outportb and > outpw are now deprecated and are no longer supported. Is there some way to > use Win32 API CreateFile and the Win32 communications functions under > Dev-C++? > Thanks in advance > > Alex Cosic > > > -----Original Message----- > From: Yeoh HS [mailto:ye...@ya...] > Sent: Thursday, 26 April 2001 11:01 AM > To: dev...@li... > Subject: Re: [Dev-C++] Serial Communication > > > Hi, > > Try this site: > http://www.beyondlogic.org/serial/serial1.htm > > Yeoh > > ----- Original Message ----- > From: Alex Cosic <al...@ca...> > To: <Dev...@li...> > Sent: Thursday, April 26, 2001 8:29 AM > Subject: [Dev-C++] Serial Communication > > > > Hi there, > > > > I am looking for some information on how to establish serial communication > > with Dev-C++. I sthere some rourines to establish serial connection with > let > > 's say com2 port? > > > > I have read winbase.hand it seems to be possible but I could not get the > > exact command. There is a structure to do that, but there is no enough > > information to write simple routine for serail communication. > > Thanks in davance > > > > Regards > > > > Alex Cosic > > > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
|
From: Alex C. <al...@ca...> - 2001-04-26 01:22:35
|
Thank for info.I understand that but: Direct hardware access in 32-bit Windows is generally not allowed. While it can be done in the Win9x OS by using inline assembly, this is generally discouraged as this technique is not supported under WinNT. The hardware port communication family of functions, such as inportb, inpw, outportb and outpw are now deprecated and are no longer supported. Is there some way to use Win32 API CreateFile and the Win32 communications functions under Dev-C++? Thanks in advance Alex Cosic -----Original Message----- From: Yeoh HS [mailto:ye...@ya...] Sent: Thursday, 26 April 2001 11:01 AM To: dev...@li... Subject: Re: [Dev-C++] Serial Communication Hi, Try this site: http://www.beyondlogic.org/serial/serial1.htm Yeoh ----- Original Message ----- From: Alex Cosic <al...@ca...> To: <Dev...@li...> Sent: Thursday, April 26, 2001 8:29 AM Subject: [Dev-C++] Serial Communication > Hi there, > > I am looking for some information on how to establish serial communication > with Dev-C++. I sthere some rourines to establish serial connection with let > 's say com2 port? > > I have read winbase.hand it seems to be possible but I could not get the > exact command. There is a structure to do that, but there is no enough > information to write simple routine for serail communication. > Thanks in davance > > Regards > > Alex Cosic > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ Dev-cpp-users mailing list Dev...@li... http://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Yeoh H. <ye...@ya...> - 2001-04-26 00:56:01
|
Hi, Try this site: http://www.beyondlogic.org/serial/serial1.htm Yeoh ----- Original Message ----- From: Alex Cosic <al...@ca...> To: <Dev...@li...> Sent: Thursday, April 26, 2001 8:29 AM Subject: [Dev-C++] Serial Communication > Hi there, > > I am looking for some information on how to establish serial communication > with Dev-C++. I sthere some rourines to establish serial connection with let > 's say com2 port? > > I have read winbase.hand it seems to be possible but I could not get the > exact command. There is a structure to do that, but there is no enough > information to write simple routine for serail communication. > Thanks in davance > > Regards > > Alex Cosic > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
|
From: Alex C. <al...@ca...> - 2001-04-26 00:27:54
|
Hi there, I am looking for some information on how to establish serial communication with Dev-C++. I sthere some rourines to establish serial connection with let 's say com2 port? I have read winbase.hand it seems to be possible but I could not get the exact command. There is a structure to do that, but there is no enough information to write simple routine for serail communication. Thanks in davance Regards Alex Cosic |
|
From: Yeoh H. <ye...@ya...> - 2001-04-25 10:36:15
|
Hi, There's one in the LCC-Win32 package. Yeoh ----- Original Message -----=20 From: Frazell Thomas=20 To: Dev...@li...=20 Sent: Wednesday, April 25, 2001 10:07 AM Subject: [Dev-C++] I need some help.... Can anyone tell me where I may obtain a Visual Resource Editor for = resource files (C/C++ programming languages thanks) =20 - Frazell Thomas =20 |
|
From: PEPIN D. <den...@wo...> - 2001-04-25 08:08:25
|
hi
I am French and so, I use some accents.
In a program, all is right. But if I define a constant string, accents =
aren't recognized.
What's happens ?
I make a little function who correct constant strings :
-------------------------------------------------------------------------=
-------------------------------------
#include <stdio.h>
#include <iostream.h> =20
#include<conio.h> =20
#include <stdlib.h> =20
void correct(char chaine[]);
void main()
{
char chaine[]=3D"=E9=E8=E7=E0=F9=E2=EA=FB=EE=F4=EB=FC=EF"; // =
string with accents if you don't see the right string
cout << chaine <<"\n\n"; =20
getch();
correct(chaine);
cout << chaine << "\n\n";
getch();
}
void correct(char chaine[])
{
for(int i=3D0;chaine[i]!=3D0;i++)
{
if(chaine[i]=3D=3D'=E9'){chaine[i]+=3D153;} // '=E9' is e with =
acute accent
else if(chaine[i]=3D=3D'=E0'){chaine[i]+=3D165;} // '=E0' is a with =
grave accent
else if(chaine[i]=3D=3D'=E8'){chaine[i]+=3D162;}
else if(chaine[i]=3D=3D'=F9'){chaine[i]+=3D158;}
else if(chaine[i]=3D=3D'=E2'){chaine[i]+=3D161;}
else if(chaine[i]=3D=3D'=EA'){chaine[i]+=3D158;}
else if(chaine[i]=3D=3D'=EE'){chaine[i]+=3D158;}
else if(chaine[i]=3D=3D'=F4'){chaine[i]+=3D159;}
else if(chaine[i]=3D=3D'=FB'){chaine[i]+=3D155;}
else if(chaine[i]=3D=3D'=EB'){chaine[i]+=3D158;}
else if(chaine[i]=3D=3D'=EF'){chaine[i]+=3D156;}
else if(chaine[i]=3D=3D'=FC'){chaine[i]+=3D133;}
else if(chaine[i]=3D=3D'=E7'){chaine[i]+=3D160;}
}
}
-------------------------------------------------------------------------=
------------------------------------------
Could I solve my problem without function ?
Thanks for help
Denis
|