dev-cpp-users Mailing List for Dev-C++ (Page 2)
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
(18) |
2
(3) |
3
(5) |
4
(10) |
5
(2) |
6
(15) |
7
(10) |
8
(17) |
9
(28) |
10
(9) |
11
(20) |
12
(27) |
13
(16) |
14
(2) |
15
(5) |
16
(11) |
17
(6) |
18
(10) |
19
(21) |
20
(24) |
21
(15) |
22
(13) |
23
(26) |
24
(8) |
25
(9) |
26
(11) |
27
(13) |
28
(3) |
29
(4) |
30
(26) |
|
|
|
|
|
From: Ioannis V. <iv...@em...> - 2003-06-30 00:12:35
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of David McKen > Sent: Monday, June 30, 2003 2:31 AM > To: Dev-Cpp Mailing List > Subject: [Dev-C++] Portable End-of-Line >=20 >=20 > Is there a portable way of finding out the end-of line > sequence for the > current operating system? I hope to make my program > portable to both Win + > *NIX and would like something more (what word could go > here?) than: >=20 > #ifdef WIN32 > const char DIR_SEP =3D '\\'; > const char eoln[] =3D "\n"; > #else > const char DIR_SEP =3D '/'; > const char eoln[] =3D "\n\r"; "\n\r" also applies at least to .NET text boxes. In any case only '\n' is portable. > #endif >=20 > Same applies to the directory separator. Is there a way I > can detect which > one is used? As I said portability is of utmost importance > so it must be C++ > ANSI compliant (my program uses classes so it cant be a C > compliant program. From my limited experience those "\n\r" etc sequences apply only to GUI programs. Any way, about line change since '\n' exists in all cases you can detect = it by reading character by character. If you want to display it consider it = as a system extension and you can handle it as all system extensions by encapsulating it to a small portion of your program: Example: // Unportable encapsulations namespace uenc { const string eol=3D"\n"; inline void clearscr() { system("cls"); } // ... } So when you want to compile the program in another platform you have = only to change those encapsulations. And try to forget the ancient C style stuff where C++ provides superior alternatives. Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
From: David M. <ci...@ya...> - 2003-06-29 23:30:49
|
Is there a portable way of finding out the end-of line sequence for the current operating system? I hope to make my program portable to both Win + *NIX and would like something more (what word could go here?) than: #ifdef WIN32 const char DIR_SEP = '\\'; const char eoln[] = "\n"; #else const char DIR_SEP = '/'; const char eoln[] = "\n\r"; #endif Same applies to the directory separator. Is there a way I can detect which one is used? As I said portability is of utmost importance so it must be C++ ANSI compliant (my program uses classes so it cant be a C compliant program. Signed David Mcken __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |
From: Colin L. <ha...@bl...> - 2003-06-29 14:20:26
|
Hi, We are working on it, through a new site for Dev-C++. Hopefully we should finish it soon :) Greetings, Colin On Thursday 26 June 2003 00:12, you wrote: > Hi all, > > Is there a DevPak repository where we can post (get..:o) DevPak's? > > Best Regards > Staale > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
From: Ioannis V. <iv...@em...> - 2003-06-29 02:29:27
|
Well since everyone is sleeping, here is a classic one for C programmers: http://home.datacomm.ch/t_wolf/tw/c/ten_commandments.html Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
From: andreithomaz <and...@bo...> - 2003-06-29 02:18:49
|
hello list, with to the help of some members of this list, and of some friends of mine, I got to finish the screensaver that generates and solves a maze. But now there is another problem: it works fine in fullscreen but, when a fraction of it is shown in the "Control Panel->Video" (my Windows is in Portuguese, so maybe it is "Control Pane->Screen", I don't know), it crashes if it starts three times. Has anybody had this problem in the past? I tried some changes in the way that memory allocation is done, but nothing worked... the code, and the screensaver, is in http://www.civitas.lelic.ufrgs.br/andrei/dedalo_ariadne1.zip thank you, andrei -- Andrei R. Thomaz and...@bo... fone: 92067436 |
From: Abhijit S. <mu...@gm...> - 2003-06-28 17:55:14
|
> Does anybody know why this piece of code does not work? It gives > me an "invalid pointer operation". Have you actually #include'd main.h from resource.h? If not, try including it. If it gives errors, move all the resource-related defines into a separate file (usually with an extention .rh) and included it in both the main header and resource file. It would be a good idea to make the rh file re-entrant using this technique: -- start file `foo.rh' -- #ifndef _FOO_RH #define _FOO_RH #define IDC_NUMBER 610 #endif // _FOO_RH -- stop file `foo.h' -- If you understand how a pre-processor works, this should make sense. The _FOO_RH is only convention (generated from the filename). You can name it anyway you like, as long as it doesn't conflict with any other macros. HTH. -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
From: Abhijit S. <mu...@gm...> - 2003-06-28 17:54:58
|
Hello, Carlson. > // I am posting this on the internet for new people so they won't have to > // try and figure this all out from scratch. It took me a long time > and > // in general I know how to program but the std::library stuff is > taking > // me longer than I thought to learn. Why not start an open-source project, create a website for it, and announce it on Freshmeat? Please don't post complete source-code for the program, as you update it, here. It can eat up a lot of bandwidth over time. Besides, this mailing-list is not intended for that. At the very least, upload it to a site and post the URL, along with a text of changes, here. Also, posting it to a site will give it greater exposure to web-search engines, so more people can benefit from your code, rather than only the handful of C++ programmers who are subscribed to this list. -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
From: <ni...@ko...> - 2003-06-28 07:09:26
|
From: Matthews <dem...@uw...> - 2003-06-27 19:59:06
|
So why are you sending this code to the Dev-C++ mailing list again? And personally, I find your use of overuse of comments annoying. At 04:14 AM 27/06/2003 -0700, CARLSON, JAY MM1 wrote: >For all new programmers, if you follow these programs from me you will see >some examples of how I write code, (good or bad). The initial version of >this program would search for a text and replace it with another text. It >did that but I have a much larger purpose in mind. My end goal is to make a >program (that anyone can use - although I don't know how many would want to) >that will take a file that I want to import into Access 2000 and strip off >all the junk headers and footers that keep the columns from importing >without errors. > >The multiple search and replace function is step two in what I believe will >be a 4 step process. Step three will be to open files and read text, >already done, but will post later. >Step 4 will be to combine steps 3 and 2 into a coherent program. > >Here is step two. > >// Multiple Search and Replace Function >// For use and analysis especially for new programmers >// >// Praise God for His Goodness and Mercy >// 27 June 2003 Jay A Carlson > >// Multiple Search and Replace Implementation and Testing >// >// Takes an input text and replacement text and makes it happen >// In the future I will have an input text file and a change file >// to end up with a new converted file. >// >// The search and replace specifications take the form of >// <> <search for this> <replace with this>; >// number of replacements (0 means replace all) >// >// [] [search] [replace] >// 5 >// >// <> <myArray[9]> <thisArray[10]> >// 3 >// >// ^* ^std::cout<<test[5];* ^printf("test[3]");* >// 0 >// >// Notice by being able to specify the start and stop delimiters for each >// search and replace you don't have to worry about nesting problems. >// >// abbreviations used >// srt -- search and replace text >// arc = actual_replacement_count >// drc = desired_replacement_count > >#include <iostream> // for std::cout >#include <string> // for std::string >#include <vector> // guess what - for vectors > >// this is a function whose sole purpose in life is to get the word, or >words >// between the delimiters represented by the variables start and stop >// debug -- a way of showing more or less information in a hurry >std::string getword_s(char start, char stop, std::string &srt) { > unsigned int first = srt.find_first_of(start) + 1; > unsigned int last = srt.find_first_of(stop) - 1; > unsigned int len = last - first + 1; // length of word(s) between >delimiters > // get the substring of srt, starting at position first (delimeter +1) >and > // go for len charachers. If len is larger than the string srt it >will > // just stop at the end. > std::string word = srt.substr(first, len); > // now that we got the word(s) we wanted out between the delimiters, it >is > // time to remove that section so that we can work with the next part, if > > // any. > srt = srt.substr(last + 2, srt.length()); > return word; > } > >// the name says it all >void search_and_replace(std::string &text, std::string &srt, > unsigned int drc, const bool debug) { > // I didn't want accidental spaces to cause the program to glitch > // so in the next few lines I remove all spaces before delimiters. > // This also simplfied getting the delimiters > unsigned int eatwhite = srt.find_first_not_of(' '); > srt = srt.substr(eatwhite,srt.length()); > char start = srt[0]; // the starting delimiter is now the first char in >srt > srt = srt.substr(1,srt.length()); > eatwhite = srt.find_first_not_of(' '); > srt = srt.substr(eatwhite,srt.length()); > char stop = srt[0]; // the ending delimiter is now the first char in >srt > if (debug) { > std::cout << "\nStart Delimiter = " << start; > std::cout << "\nStop Delimiter = " << stop; > } > // remove the delimiter specifiers so we can look for the search > // and replace words > srt = srt.substr(2, srt.length()-1); > // get the word(s) for the search part > std::string search = getword_s(start, stop, srt); > if (debug) std::cout << "\n"; > // get the word(s) for the replace part > std::string replace = getword_s(start, stop, srt); > if (debug) { > std::cout << "\nThe word(s) to search for is/are : \"" << search << >"\""; > std::cout << "\nThe word(s) to replace with is/are: \"" << replace << >"\""; > std::cout << "\n"; > } > // pos and new_pos are needed to prevent recursive replacements of >text > // resulting in a "loop until crash condition" > unsigned int pos = 0; > unsigned int new_pos = 0; > unsigned int arc = 0; > // Part one of while (before the "and") > // Need to check to see that what your searching for is there before > // you try to replace it. If it is not there you can't replace it, >and > // your program will terminate before you can view any std::cout >data. > // Part two of while (after the "and") > // While advancing through the text making replacments continue if > // the desired number of replacements hasn't yet been made or > // "replace all" if desired replacement count equals zero. > while (text.length() > text.find(search,pos) and ((arc < drc) or (drc >== 0))) { > // If the search word is not found, it cannot be replaced!! > // mark the place of where the next new position will be > new_pos = text.find(search,pos) + replace.length()-1; > // make the string replacement > text = text.replace(text.find(search,pos), search.length(), >replace); > // go to the new position (after the string replacement) to prevent > // a recursive string replacement (and subsequent crash) > pos = new_pos; > arc++; // advance actual replacement counter. > } // end of while > std::cout << "\nActual Replacement Count = " << arc; > } // end of function > >int main(void) { > bool debug = true; // toggle to see more details > std::string original = "I will be 40 40 40 40 40 next year."; > std::string new_text = original; > // Oh yeah - here I am experimenting with vectors of strings > // Vectors are almost like arrays, but better > std::vector<std::string>srt(6); // srt - search and replace text > std::vector<unsigned int>drc(6); > // Test no match condition > srt[0] = " < > <35> <34>"; > drc[0] = 4; > // Test replace with same size > srt[1] = " ( ) (40) (38)"; > drc[1] = 3; > // Test replace with smaller size > srt[2] = "[ ] [ 38] []"; > drc[2] = 0; > // Test replace with a bigger text > srt[3] = "[] [next] [a very old man next]"; > drc[3] = 3; > // Test replace > srt[4] = "[] [40] []"; > drc[4] = 2; > // Test replace > srt[5] = "[] [ ] [ ]"; > drc[5] = 1; > > for(int i = 0; i < 6; i++) { > std::cout << "\n\n\n\n\n\n\n\n\n\n\n\n\nSearch and Replace Text = " ><< srt[i]; > if (drc[i] == 0) std::cout << "\nDesired Replacement Count = All"; > else std::cout << "\nDesired Replacement Count = " << drc[i]; > search_and_replace(new_text, srt[i], drc[i], debug); > std::cout << "\nOriginal text: = " << original; > std::cout << "\nNew text: = " << new_text; > std::cout << "\n\n"; > system("pause"); > original = new_text; > } > return 0; >} >// Praise God for His Goodness and Mercy >// Jay A. Carlson >// >// Constuctive criticism will be appreciated. > > >------------------------------------------------------- >This SF.Net email is sponsored by: INetU >Attention Web Developers & Consultants: Become An INetU Hosting Partner. >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
From: Graham D. <g.d...@nt...> - 2003-06-27 19:26:57
|
Critique added below. I hope that I've been constructive - if it comes over otherwise, please accept that that is not my intention. I get the impression from earlier postings that you've made that you are fairly new to STL (and possibly C++?). On that assumption, I've tried to make as many detailed critiques as I could think of. If I'm wrong in my assumption, again accept my apologies. In particular, I have a real "thing" about over-commented code, as you'll see. For one thing, I simply detest blindingly obvious comments like "x = x + 1; // Add 1 to x". There are many reasons for my dislike of excessive comments, including: * comments get in the way of finding the real code (not everyone has syntax colouring), so keep them to a necessary minimum; * comments tend not to get updated to reflect what modified code does, and so start lying; * good code comments itself. The first two there come from many painful years of trawling through badly (over-)commented code. The last one comes from a Scott Meyers comment: "Say what you mean and understand what you are saying". If you can write good code, you can read good code. If you can't write good code, then you can learn a lot by reading good code. So, if any of my comments below seem a bit "tart", please accept my apologies in advance: they're not meant to be, I just wanted to try to keep them short. By the way, I also appreciate that you may have written the code for a rigidly defined input domain. However, my experience is that such code lasts a couple of months before someone wants to use it more widely. Hence, I've made a number of comments about (lack of) error checking, even though you may argue that it's not necessary for the input you expect. CARLSON, JAY MM1 wrote: >For all new programmers, if you follow these programs from me you will see >some examples of how I write code, (good or bad). The initial version of >this program would search for a text and replace it with another text. It >did that but I have a much larger purpose in mind. My end goal is to make a >program (that anyone can use - although I don't know how many would want to) >that will take a file that I want to import into Access 2000 and strip off >all the junk headers and footers that keep the columns from importing >without errors. > >The multiple search and replace function is step two in what I believe will >be a 4 step process. Step three will be to open files and read text, >already done, but will post later. >Step 4 will be to combine steps 3 and 2 into a coherent program. > >Here is step two. > >// Multiple Search and Replace Function >// For use and analysis especially for new programmers >// >// Praise God for His Goodness and Mercy >// 27 June 2003 Jay A Carlson > >// Multiple Search and Replace Implementation and Testing >// >// Takes an input text and replacement text and makes it happen >// In the future I will have an input text file and a change file >// to end up with a new converted file. >// >// The search and replace specifications take the form of >// <> <search for this> <replace with this>; >// number of replacements (0 means replace all) >// >// [] [search] [replace] >// 5 >// >// <> <myArray[9]> <thisArray[10]> >// 3 >// >// ^* ^std::cout<<test[5];* ^printf("test[3]");* >// 0 >// >// Notice by being able to specify the start and stop delimiters for each >// search and replace you don't have to worry about nesting problems. >// >// abbreviations used >// srt -- search and replace text > But it isn't, is it? There is no search and replace text - there's search text, and there's replace text and they are separate. Unless you mean the text that is to be searched and modified.... >// arc = actual_replacement_count >// drc = desired_replacement_count > Rather than add this comment, use the long names for the variables in the code. > >#include <iostream> // for std::cout >#include <string> // for std::string >#include <vector> // guess what - for vectors > Anyone who needs those comments on the #includes isn't qualified to be reading the code. (And if they're reading for learning purposes, and don't know those includes, then they aren't going to learn anything.) > >// this is a function whose sole purpose in life is to get the word, or >words >// between the delimiters represented by the variables start and stop >// debug -- a way of showing more or less information in a hurry > The function name - getword_s - tends to belie the above comment. The description is of a form of substring, not "get word", which implies the characters between two white space or punctuation characters. >std::string getword_s(char start, char stop, std::string &srt) { > Personally, I wouldn't used unsigned for anything other than bit manipulation. There are too many awkward implications from using unsigned. > unsigned int first = srt.find_first_of(start) + 1; > What happens if find_first_of(start) returns npos? Note that basic_string::npos is defined as static const size_type npos = -1; What implication does that have for the future correctness of your search? > unsigned int last = srt.find_first_of(stop) - 1; > What if "stop" appears in the string earlier than "start"? > unsigned int len = last - first + 1; // length of word(s) between >delimiters > "last" should point to the next occurence of "stop" after "start". If "last - first + 1" evaluates to < 0, then len is going to be a huge number (one of those implications of unsigned I mentioned). > // get the substring of srt, starting at position first (delimeter +1) >and > // go for len charachers. If len is larger than the string srt it >will > // just stop at the end. > More obvious comments - it doesn't take much programming experience to see what the code does. > std::string word = srt.substr(first, len); > Again, "word" is a misleading name. To repeat, what happens if first == npos? > // now that we got the word(s) we wanted out between the delimiters, it >is > // time to remove that section so that we can work with the next part, if > > // any. > The comment is superfluous (and optimistic - many things could have gone wrong). > srt = srt.substr(last + 2, srt.length()); > return word; > } > >// the name says it all >void search_and_replace(std::string &text, std::string &srt, > unsigned int drc, const bool debug) { > Don't make a debug flag part of the function signature - it's got nothing to do with the function's purpose and removing it before releasing the code is going to be a pain. Also, marking a value parameter "const" is a waste of time. > // I didn't want accidental spaces to cause the program to glitch > // so in the next few lines I remove all spaces before delimiters. > // This also simplfied getting the delimiters > unsigned int eatwhite = srt.find_first_not_of(' '); > What if someone uses tab characters to separate the bits? > srt = srt.substr(eatwhite,srt.length()); > char start = srt[0]; // the starting delimiter is now the first char in >srt > Error condition not checked - what if srt.length() == 0? Undefined behaviour can result from this. > srt = srt.substr(1,srt.length()); > Error condition not checked - what if srt.length() < 2? > eatwhite = srt.find_first_not_of(' '); > srt = srt.substr(eatwhite,srt.length()); > What if eatwhite == npos? > char stop = srt[0]; // the ending delimiter is now the first char in >srt > What if srt.length() == 0? > if (debug) { > std::cout << "\nStart Delimiter = " << start; > std::cout << "\nStop Delimiter = " << stop; > } > // remove the delimiter specifiers so we can look for the search > // and replace words > srt = srt.substr(2, srt.length()-1); > // get the word(s) for the search part > std::string search = getword_s(start, stop, srt); > if (debug) std::cout << "\n"; > // get the word(s) for the replace part > std::string replace = getword_s(start, stop, srt); > if (debug) { > std::cout << "\nThe word(s) to search for is/are : \"" << search << >"\""; > std::cout << "\nThe word(s) to replace with is/are: \"" << replace << >"\""; > std::cout << "\n"; > } > // pos and new_pos are needed to prevent recursive replacements of >text > // resulting in a "loop until crash condition" > Actually, this comment doesn't tell me much. Why might there be a recursive replacement going on? How do they prevent it? As someone with 20+ years programming experience, I wouldn't have associated recursion as a problem with search and replace - there's simply a certain condition that one has to avoid. If the code is well-written, that avoidance will be obvious. By spuriously mentioning preventative measures like this, you cloud the preconceptions of someone reading the code - I'm now looking for possible recursion, rather than seeing if the code does what it supposed to do > unsigned int pos = 0; > unsigned int new_pos = 0; > unsigned int arc = 0; > // Part one of while (before the "and") > // Need to check to see that what your searching for is there before > // you try to replace it. If it is not there you can't replace it, >and > // your program will terminate before you can view any std::cout >data. > This comment is obvious and unnecessary. > // Part two of while (after the "and") > // While advancing through the text making replacments continue if > // the desired number of replacements hasn't yet been made or > // "replace all" if desired replacement count equals zero. > Also obvious and unnecessary > while (text.length() > text.find(search,pos) and ((arc < drc) or (drc >== 0))) { > Backing up what I said about using the long names in code: The expression (actual_replacement_count < desired_replacement_count) or (desired_replacement_count == 0) would have saved me having to scroll back up the code before I could figure out if it did what it said. It also doesn't need extra commentary, since it's obvious from the code what it's doing. In fact, if you set desired_replacement_count to MAX_INT (when it was zero) before getting here, you wouldn't need the second half of the expression. Also, although "and" and "or" are legal C++, it's usually better to stick to && and ||, since that's what most people expect to see. What would you think of this: while (condition) ??< // code ??< (also legal). > // If the search word is not found, it cannot be replaced!! > Again, obvious and unnecessary. > // mark the place of where the next new position will be > new_pos = text.find(search,pos) + replace.length()-1; > // make the string replacement > Two more comments that add nothing to what the code says. > text = text.replace(text.find(search,pos), search.length(), >replace); > // go to the new position (after the string replacement) to prevent > // a recursive string replacement (and subsequent crash) > And here we get to it. Well of course you do this. It's obvious that you need to move on past the bit you've just done - it's not worth remarking on. And it's not recursive - it's just that it could fail to terminate. > pos = new_pos; > arc++; // advance actual replacement counter. > Yes, I know that's what "++" does. > } // end of while > std::cout << "\nActual Replacement Count = " << arc; > } // end of function > >int main(void) { > bool debug = true; // toggle to see more details > std::string original = "I will be 40 40 40 40 40 next year."; > std::string new_text = original; > // Oh yeah - here I am experimenting with vectors of strings > // Vectors are almost like arrays, but better > std::vector<std::string>srt(6); // srt - search and replace text > std::vector<unsigned int>drc(6); > > // Test no match condition > srt[0] = " < > <35> <34>"; > drc[0] = 4; > // Test replace with same size > srt[1] = " ( ) (40) (38)"; > drc[1] = 3; > // Test replace with smaller size > srt[2] = "[ ] [ 38] []"; > drc[2] = 0; > // Test replace with a bigger text > srt[3] = "[] [next] [a very old man next]"; > drc[3] = 3; > // Test replace > srt[4] = "[] [40] []"; > drc[4] = 2; > // Test replace > srt[5] = "[] [ ] [ ]"; > drc[5] = 1; > > for(int i = 0; i < 6; i++) { > std::cout << "\n\n\n\n\n\n\n\n\n\n\n\n\nSearch and Replace Text = " ><< srt[i]; > if (drc[i] == 0) std::cout << "\nDesired Replacement Count = All"; > else std::cout << "\nDesired Replacement Count = " << drc[i]; > search_and_replace(new_text, srt[i], drc[i], debug); > std::cout << "\nOriginal text: = " << original; > std::cout << "\nNew text: = " << new_text; > std::cout << "\n\n"; > system("pause"); > original = new_text; > } > return 0; >} >// Praise God for His Goodness and Mercy >// Jay A. Carlson >// >// Constuctive criticism will be appreciated. > > >------------------------------------------------------- >This SF.Net email is sponsored by: INetU >Attention Web Developers & Consultants: Become An INetU Hosting Partner. >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > |
From: Per W. <pw...@ia...> - 2003-06-27 18:38:53
|
Whey I picked up the mail and answered, I never noticed the length of it. Because of the window height, the last line of text I saw was the lines 'God Bless', his signature and a couple of empty lines - I never even knew that there were a 40kB digest of miscellaneous earlier mails. /Per W On Fri, 27 Jun 2003, [ISO-8859-1] OROSZI Bal=E1zs wrote: > Per Westermark wrote: > > It's the result of your mail program configured to sending MIME Quoted > > Printable format. Please turn off before posting code. Some mail reader= s > > really hates this format... > > Mail readers with low bandwidth also really hate if 3 lines of text is > written as reply to a letter, and the WHOLE original letter (40 KB or > more) is quoted. I received the same mail 3 times as quotations, that > adds up to 120 KB. All the same letter. > > This way I want to ask people, to quote only that part of the letter, > which they reply to. It is a very bad habit to quote the whole message > again (it doesn't make sense anyway), and makes people's life with low > bandwidth a hell. > > Thank you. > -- > Greetings, > Bal=E1zs > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: INetU > Attention Web Developers & Consultants: Become An INetU Hosting Partner. > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
From: Daniel G. <sp...@ho...> - 2003-06-27 18:12:17
|
Your dialog is IDD_DIALOG but the controls don't have IDC identifiers, which is odd. Is this generated or have you typed it in yourself? Remember you can't use #define IDD_ etc. as a literal number, you use the identifiers to send messages to controls (like SetDlgText()). >From: "Jorge Abramian" <jab...@ma...> >Reply-To: <jab...@ma...> >To: <dev...@li...> >Subject: [Dev-C++] IDC_NUMBER, windows programming >Date: Fri, 27 Jun 2003 08:40:10 -0400 > >Does anybody know why this piece of code does not work? It gives me an >"invalid pointer operation". > >//this is part of main.h file > >#define IDD_ABOUT 100 >#define IDC_MAIN_TEXT 1001 >#define IDI_ICON 1 >#define IDD_DIALOG 600 >#define IDC_NUMBER 610 >........ > >//this is part of the resource file > >600 DIALOG DISCARDABLE 0, 0, 300, 150 >STYLE WS_VISIBLE | WS_SYSMENU | WS_POPUP | WS_CAPTION | DS_MODALFRAME >CAPTION "Dialog Box Example" >FONT 8,"Helv" >BEGIN > ICON 1,5,11,17,20,20 > DEFPUSHBUTTON "&OK",IDOK,220,18,50,14 > PUSHBUTTON "&Cancel",IDCANCEL,220,35,50,14 > GROUPBOX "Random Numbers Generator Version 1.0",102,7,60,200,60 > CTEXT "dialog box example", 103,40,75,130,40 > LTEXT "Low Limit",103,7,10,50,8 > LTEXT "High Limit",103,7,20,50,8 > EDITTEXT IDC_NUMBER,150,7,21,14,ES_NUMBER >..... >Instead if I eliminate the "#define IDC_NUMBER 1100" line of the main.h >file and make "EDITTEXT 610,150,7,21,14,ES_NUMBER" IT WORKS!! > >Thanks. > >JEA > > >------------------------------------------------------- >This SF.Net email is sponsored by: INetU >Attention Web Developers & Consultants: Become An INetU Hosting Partner. >Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! >INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Express yourself with cool emoticons - download MSN Messenger today! http://www.msn.co.uk/messenger |
From: <or...@vp...> - 2003-06-27 16:37:32
|
Per Westermark wrote: > It's the result of your mail program configured to sending MIME Quoted > Printable format. Please turn off before posting code. Some mail readers > really hates this format... Mail readers with low bandwidth also really hate if 3 lines of text is written as reply to a letter, and the WHOLE original letter (40 KB or more) is quoted. I received the same mail 3 times as quotations, that adds up to 120 KB. All the same letter. This way I want to ask people, to quote only that part of the letter, which they reply to. It is a very bad habit to quote the whole message again (it doesn't make sense anyway), and makes people's life with low bandwidth a hell. Thank you. -- Greetings, Balázs |
From: <a_g...@ya...> - 2003-06-27 13:20:52
|
Well, it looks like the graphics driver in the lower layer on accepts one pixel's data described as a byte or unsigned char, that was the case atleast where the code was written. Now you first need to find out how the graphics driver deals with the pixel data. Only then will changing this part of the code make any sense. Look for how RGB or YPrPb or YCrCb components have been described.Then, if your graphics driver supports 16bit pixels, you can safely change the typedefs or modify the function :-) > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Inge Jonckheere > Sent: Thursday, June 26, 2003 5:56 PM > To: dev...@li... > Subject: [Dev-C++] Help!! > > > Dear all, > > As a beginner, I really would appreciate your help! I am > trying to work with > Xite for image processing, actually I try to threshold > images. I have the > code in C++ for unsigned byte images, but mine are unsigned > short (16 bits), > so I have a problem.. > I really need to keep the 16-bits, so I > need to change > the code.. > Does anybody knows what IBAND as a variable is?? Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users Thanx and Regards Avik Ghose SMS using the Yahoo! Messenger;Download latest version. |
From: <a_g...@ya...> - 2003-06-27 13:03:58
|
Hi Swagat, As far as I know size_t is not a function but a typedef data type for measuring size(in memory uinits or bytes) of inbuild and user defined data types and objects. The definition is set to unsigned int I guess swagat kumar <sw...@ma...> wrote: dear friends, can anybody tell me what is the use of function "size_t" defined in the header "stddef.h". thanks in advance swagat _____________________________________________________________ Get email for your site ---> http://www.everyone.net _____________________________________________________________ Select your own custom email address for FREE! Get yo...@yo..., No Ads, 6MB, IMAP, POP, SMTP & more! http://www.everyone.net/selectmail?campaign=tag ------------------------------------------------------- This SF.Net email is sponsored by: INetU Attention Web Developers & Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission! INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users Thanx and Regards Avik Ghose SMS using the Yahoo! Messenger;Download latest version. |
From: Jorge A. <jab...@ma...> - 2003-06-27 12:40:30
|
Does anybody know why this piece of code does not work? It gives me an "invalid pointer operation". //this is part of main.h file #define IDD_ABOUT 100 #define IDC_MAIN_TEXT 1001 #define IDI_ICON 1 #define IDD_DIALOG 600 #define IDC_NUMBER 610 ........ //this is part of the resource file 600 DIALOG DISCARDABLE 0, 0, 300, 150 STYLE WS_VISIBLE | WS_SYSMENU | WS_POPUP | WS_CAPTION | DS_MODALFRAME CAPTION "Dialog Box Example" FONT 8,"Helv" BEGIN ICON 1,5,11,17,20,20 DEFPUSHBUTTON "&OK",IDOK,220,18,50,14 PUSHBUTTON "&Cancel",IDCANCEL,220,35,50,14 GROUPBOX "Random Numbers Generator Version 1.0",102,7,60,200,60 CTEXT "dialog box example", 103,40,75,130,40 LTEXT "Low Limit",103,7,10,50,8 LTEXT "High Limit",103,7,20,50,8 EDITTEXT IDC_NUMBER,150,7,21,14,ES_NUMBER ..... Instead if I eliminate the "#define IDC_NUMBER 1100" line of the main.h file and make "EDITTEXT 610,150,7,21,14,ES_NUMBER" IT WORKS!! Thanks. JEA |
From: CARLSON, J. M. <CA...@st...> - 2003-06-27 11:48:06
|
For all new programmers, if you follow these programs from me you will see some examples of how I write code, (good or bad). The initial version of this program would search for a text and replace it with another text. It did that but I have a much larger purpose in mind. My end goal is to make a program (that anyone can use - although I don't know how many would want to) that will take a file that I want to import into Access 2000 and strip off all the junk headers and footers that keep the columns from importing without errors. The multiple search and replace function is step two in what I believe will be a 4 step process. Step three will be to open files and read text, already done, but will post later. Step 4 will be to combine steps 3 and 2 into a coherent program. Here is step two. // Multiple Search and Replace Function // For use and analysis especially for new programmers // // Praise God for His Goodness and Mercy // 27 June 2003 Jay A Carlson // Multiple Search and Replace Implementation and Testing // // Takes an input text and replacement text and makes it happen // In the future I will have an input text file and a change file // to end up with a new converted file. // // The search and replace specifications take the form of // <> <search for this> <replace with this>; // number of replacements (0 means replace all) // // [] [search] [replace] // 5 // // <> <myArray[9]> <thisArray[10]> // 3 // // ^* ^std::cout<<test[5];* ^printf("test[3]");* // 0 // // Notice by being able to specify the start and stop delimiters for each // search and replace you don't have to worry about nesting problems. // // abbreviations used // srt -- search and replace text // arc = actual_replacement_count // drc = desired_replacement_count #include <iostream> // for std::cout #include <string> // for std::string #include <vector> // guess what - for vectors // this is a function whose sole purpose in life is to get the word, or words // between the delimiters represented by the variables start and stop // debug -- a way of showing more or less information in a hurry std::string getword_s(char start, char stop, std::string &srt) { unsigned int first = srt.find_first_of(start) + 1; unsigned int last = srt.find_first_of(stop) - 1; unsigned int len = last - first + 1; // length of word(s) between delimiters // get the substring of srt, starting at position first (delimeter +1) and // go for len charachers. If len is larger than the string srt it will // just stop at the end. std::string word = srt.substr(first, len); // now that we got the word(s) we wanted out between the delimiters, it is // time to remove that section so that we can work with the next part, if // any. srt = srt.substr(last + 2, srt.length()); return word; } // the name says it all void search_and_replace(std::string &text, std::string &srt, unsigned int drc, const bool debug) { // I didn't want accidental spaces to cause the program to glitch // so in the next few lines I remove all spaces before delimiters. // This also simplfied getting the delimiters unsigned int eatwhite = srt.find_first_not_of(' '); srt = srt.substr(eatwhite,srt.length()); char start = srt[0]; // the starting delimiter is now the first char in srt srt = srt.substr(1,srt.length()); eatwhite = srt.find_first_not_of(' '); srt = srt.substr(eatwhite,srt.length()); char stop = srt[0]; // the ending delimiter is now the first char in srt if (debug) { std::cout << "\nStart Delimiter = " << start; std::cout << "\nStop Delimiter = " << stop; } // remove the delimiter specifiers so we can look for the search // and replace words srt = srt.substr(2, srt.length()-1); // get the word(s) for the search part std::string search = getword_s(start, stop, srt); if (debug) std::cout << "\n"; // get the word(s) for the replace part std::string replace = getword_s(start, stop, srt); if (debug) { std::cout << "\nThe word(s) to search for is/are : \"" << search << "\""; std::cout << "\nThe word(s) to replace with is/are: \"" << replace << "\""; std::cout << "\n"; } // pos and new_pos are needed to prevent recursive replacements of text // resulting in a "loop until crash condition" unsigned int pos = 0; unsigned int new_pos = 0; unsigned int arc = 0; // Part one of while (before the "and") // Need to check to see that what your searching for is there before // you try to replace it. If it is not there you can't replace it, and // your program will terminate before you can view any std::cout data. // Part two of while (after the "and") // While advancing through the text making replacments continue if // the desired number of replacements hasn't yet been made or // "replace all" if desired replacement count equals zero. while (text.length() > text.find(search,pos) and ((arc < drc) or (drc == 0))) { // If the search word is not found, it cannot be replaced!! // mark the place of where the next new position will be new_pos = text.find(search,pos) + replace.length()-1; // make the string replacement text = text.replace(text.find(search,pos), search.length(), replace); // go to the new position (after the string replacement) to prevent // a recursive string replacement (and subsequent crash) pos = new_pos; arc++; // advance actual replacement counter. } // end of while std::cout << "\nActual Replacement Count = " << arc; } // end of function int main(void) { bool debug = true; // toggle to see more details std::string original = "I will be 40 40 40 40 40 next year."; std::string new_text = original; // Oh yeah - here I am experimenting with vectors of strings // Vectors are almost like arrays, but better std::vector<std::string>srt(6); // srt - search and replace text std::vector<unsigned int>drc(6); // Test no match condition srt[0] = " < > <35> <34>"; drc[0] = 4; // Test replace with same size srt[1] = " ( ) (40) (38)"; drc[1] = 3; // Test replace with smaller size srt[2] = "[ ] [ 38] []"; drc[2] = 0; // Test replace with a bigger text srt[3] = "[] [next] [a very old man next]"; drc[3] = 3; // Test replace srt[4] = "[] [40] []"; drc[4] = 2; // Test replace srt[5] = "[] [ ] [ ]"; drc[5] = 1; for(int i = 0; i < 6; i++) { std::cout << "\n\n\n\n\n\n\n\n\n\n\n\n\nSearch and Replace Text = " << srt[i]; if (drc[i] == 0) std::cout << "\nDesired Replacement Count = All"; else std::cout << "\nDesired Replacement Count = " << drc[i]; search_and_replace(new_text, srt[i], drc[i], debug); std::cout << "\nOriginal text: = " << original; std::cout << "\nNew text: = " << new_text; std::cout << "\n\n"; system("pause"); original = new_text; } return 0; } // Praise God for His Goodness and Mercy // Jay A. Carlson // // Constuctive criticism will be appreciated. |
From: Ioannis V. <iv...@em...> - 2003-06-27 11:08:26
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of swagat kumar > Sent: Friday, June 27, 2003 11:39 AM > To: dev...@li... > Subject: [Dev-C++] function "size_t" > > > dear friends, > > can anybody tell me what is the use of function "size_t" > defined in the header "stddef.h". In C90 and C++98 size_t is a typedef of an unsigned integer type, that is, it is one of the following: unsigned char, unsigned short, unsigned int, unsigned long. Its maximum value represents the maximum size that an object can occupy in memory. size_t is used for such sizes. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
From: Krzysztof K. <sa...@op...> - 2003-06-27 10:29:56
|
Hello swagat, Friday, June 27, 2003, 10:38:47 AM, you wrote: sk> dear friends, sk> can anybody tell me what is the use of function "size_t" defined in the header "stddef.h". sk> thanks in advance sk> swagat "size_t" is not a function, is a data type and it is a result of "sizeof" operator. It informs how many bytes has object for which you used "sizeof". The type is unsigned integer but you can't assume what kind of integer it is - 16, 32, 64 bits or more ... It depends on implementation! For example: size_t nIntSize = sizeof(long); // nIntSize will be 4 -- Best regards, Krzysztof mailto:sa...@op... http://www.saveman.w.pl |
From: swagat k. <sw...@ma...> - 2003-06-27 08:38:49
|
dear friends, can anybody tell me what is the use of function "size_t" defined in the header "stddef.h". thanks in advance swagat _____________________________________________________________ Get email for your site ---> http://www.everyone.net _____________________________________________________________ Select your own custom email address for FREE! Get yo...@yo..., No Ads, 6MB, IMAP, POP, SMTP & more! http://www.everyone.net/selectmail?campaign=tag |
From: Tony M. <to...@ho...> - 2003-06-27 05:48:32
|
Hello, I've been trying to create an import library for a DLL created with MSVC. I've had little succes... I've tried some of the solutions found on http://www.mingw.org/mingwfaq.shtml#faq-msvcdll, but none of them have produced a file that Dev-C++ will link with. The library in question is: http://www.activeworlds.com/sdk This is the complete log of when I attempt to compile. Note that I do have the import library correctly listed under "Project Options" -> "Parameters" -> "Linker". ================================================================================== Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\Projects\AWBot\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\Projects\AWBot\Makefile.win" all gcc.exe -c main.c -o main.o -I"C:/Dev-Cpp/include" gcc.exe main.o -o "awbot.exe" -L"C:/Dev-Cpp/lib" ../../lib/aw31.a main.o(.text+0x18d):main.c: undefined reference to `_imp__aw_init' main.o(.text+0x1c7):main.c: undefined reference to `_imp__aw_event_set' main.o(.text+0x1da):main.c: undefined reference to `_imp__aw_create' main.o(.text+0x223):main.c: undefined reference to `_imp__aw_int_set' main.o(.text+0x23a):main.c: undefined reference to `_imp__aw_string_set' main.o(.text+0x24e):main.c: undefined reference to `_imp__aw_string_set' main.o(.text+0x262):main.c: undefined reference to `_imp__aw_string_set' main.o(.text+0x26c):main.c: undefined reference to `_imp__aw_login' main.o(.text+0x2a1):main.c: undefined reference to `_imp__aw_enter' main.o(.text+0x2de):main.c: undefined reference to `_imp__aw_int_set' main.o(.text+0x2f5):main.c: undefined reference to `_imp__aw_int_set' main.o(.text+0x30c):main.c: undefined reference to `_imp__aw_int_set' main.o(.text+0x316):main.c: undefined reference to `_imp__aw_state_change' main.o(.text+0x349):main.c: undefined reference to `_imp__aw_wait' main.o(.text+0x357):main.c: undefined reference to `_imp__aw_destroy' main.o(.text+0x35e):main.c: undefined reference to `_imp__aw_term' main.o(.text+0x396):main.c: undefined reference to `_imp__aw_string' main.o(.text+0x3b9):main.c: undefined reference to `_imp__aw_say' main.o(.text+0x3ce):main.c: undefined reference to `_imp__aw_string' make.exe: *** [awbot.exe] Error 1 Execution terminated ================================================================================== This is with Dev-C++ 4.9.8.0. |
From: Ioannis V. <iv...@em...> - 2003-06-26 23:50:43
|
A correction: > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Inge Jonckheere > Sent: Thursday, June 26, 2003 5:56 PM > To: dev...@li... > Subject: [Dev-C++] Help!! > > > Dear all, > > As a beginner, I really would appreciate your help! I am > trying to work with > Xite for image processing, actually I try to threshold > images. I have the > code in C++ for unsigned byte images, but mine are unsigned > short (16 bits), > so I have a problem.. No intention to offend you but the term unsigned byte sounds a bit stupid. Perhaps you mean unsigned char? > I really need to keep the 16-bits, so I > need to change > the code.. I do not understand, you want to use 16-bit bytes? In a 8-bit byte system you can create a type which includes 16 continuous bits in the style: struct f16 { ==> unsigned char bits[2]; }; To add checking how many bits unsigned char has, and act accordingly: #include <limits.h> /* ... */ struct f16 { unsigned char bits[CHAR_BIT/8]; }; > Does anybody knows what IBAND as a variable is?? I don't. Probably it is some typedef defined in one of those header files used. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
From: Ioannis V. <iv...@em...> - 2003-06-26 23:47:55
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Inge Jonckheere > Sent: Thursday, June 26, 2003 5:56 PM > To: dev...@li... > Subject: [Dev-C++] Help!! > > > Dear all, > > As a beginner, I really would appreciate your help! I am > trying to work with > Xite for image processing, actually I try to threshold > images. I have the > code in C++ for unsigned byte images, but mine are unsigned > short (16 bits), > so I have a problem.. No intention to offend you but the term unsigned byte sounds a bit stupid. Perhaps you mean unsigned char? > I really need to keep the 16-bits, so I > need to change > the code.. I do not understand, you want to use 16-bit bytes? In a 8-bit byte system you can create a type which includes 16 continuous bits in the style: struct f16 { unsigned bits char[2]; }; To add checking how many bits unsigned char has, and act accordingly: #include <limits.h> /* ... */ struct f16 { unsigned char bits[CHAR_BIT/8]; }; > Does anybody knows what IBAND as a variable is?? I don't. Probably it is some typedef defined in one of those header files used. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
From: <sol...@ya...> - 2003-06-26 19:29:26
|
I'm not sure if I asked yet this and it weren't answered, but... Always I use that function I get the error code 8 (NOT_ENOUGH_MEMORY) and a black bitmap, and I don't know how to make it work. When I use CreateDIBitmap with the same bitmapinfo and bits buffer the bitmap is built correctly. How shall I use that function neither the winapi reference neither the books and tutorials I have say anything useful for me. |
From: Inge J. <Ing...@ag...> - 2003-06-26 15:20:46
|
Dear all, As a beginner, I really would appreciate your help! I am trying to work with Xite for image processing, actually I try to threshold images. I have the code in C++ for unsigned byte images, but mine are unsigned short (16 bits), so I have a problem.. I really need to keep the 16-bits, so I need to change the code.. Does anybody knows what IBAND as a variable is?? Thanks a lot, I included the code.. Inge Ir. Inge Jonckheere Research Associate Department Landmanagement Vital Decosterstraat 102 B-3000 Leuven Belgium http://perswww.kuleuven.ac.be/~u0027178/VCard/mycard.php?name=ingej |