dev-cpp-users Mailing List for Dev-C++ (Page 159)
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: <or...@vp...> - 2004-12-23 17:20:24
|
Andre Macario Barros wrote: > -->The error message after the compilation attempt is: > "Line 38 in file poppad2.rc: parse error" Common with old versions of windres. Update your resource compiler (windres.exe) to the latest version. -- Greets, Bal=E1zs |
|
From: Malcolm N. <m.n...@wa...> - 2004-12-23 17:06:44
|
Hello Andre, On 23 December 2004, 16:12:41, you wrote: > Dear Users, > I have a project file which is a Charles Petzold, chapter 10,=20 > poppad2.c example. =20 > All example files from this book are made for Visual C++. Up to this > example in this chapter I am getting success to adapt them to Dev. > But this example is presenting one parse error that I can=B4t discover > what=B4s grong.=20 I can actually get this to compile (and even run correctly when I add a return value to AskConfirmation (int AskConfirmation (HWND hwnd)) but that is probably just a mistype. What you need to do is create an empty windows project, or use the Windows Application template and replace the contents of the provided main.cpp file with your popadd2.c file. Add the resources.h and popadd.rc files too the project, press F9 and look at your program runing. I would suggest creating an empty windows project to save yourself a bit of cutting and pasting every time you need to create a new project from the book. --=20 Best regards, Malcolm mailto:m.n...@wa... |
|
From: Andre M. B. <ab...@cp...> - 2004-12-23 15:12:58
|
Dear Users,
I have a project file which is a Charles Petzold, chapter 10,=20
poppad2.c example.
=20
All example files from this book are made for Visual C++. Up to this
example in this chapter I am getting success to adapt them to Dev.
But this example is presenting one parse error that I can=B4t discover
what=B4s grong.=20
-->Here are the codes:
///////////////////////////////
***file "poppad2.c"
#include <windows.h>
#include "resource.h"
#define ID_EDIT 1
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
TCHAR szAppName[] =3D TEXT ("PopPad2") ;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
HACCEL hAccel ;
HWND hwnd ;
MSG msg ;
WNDCLASS wndclass ;
wndclass.style =3D CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc =3D WndProc ;
wndclass.cbClsExtra =3D 0 ;
wndclass.cbWndExtra =3D 0 ;
wndclass.hInstance =3D hInstance ;
wndclass.hIcon =3D LoadIcon (hInstance, szAppName) ;
wndclass.hCursor =3D LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground =3D (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName =3D szAppName ;
wndclass.lpszClassName =3D szAppName ;
=20
if (!RegisterClass (&wndclass))
{
MessageBox (NULL, TEXT ("This program requires Windows NT!"),
szAppName, MB_ICONERROR) ;
return 0 ;
}
=20
hwnd =3D CreateWindow (szAppName, szAppName,
WS_OVERLAPPEDWINDOW,
GetSystemMetrics (SM_CXSCREEN) / 4,
GetSystemMetrics (SM_CYSCREEN) / 4,
GetSystemMetrics (SM_CXSCREEN) / 2,
GetSystemMetrics (SM_CYSCREEN) / 2,
NULL, NULL, hInstance, NULL) ;
=20
ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;=20
=20
hAccel =3D LoadAccelerators (hInstance, szAppName) ;
=20
while (GetMessage (&msg, NULL, 0, 0))
{
if (!TranslateAccelerator (hwnd, hAccel, &msg))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
}
return msg.wParam ;
}
AskConfirmation (HWND hwnd)
{
return MessageBox (hwnd, TEXT ("Really want to close PopPad2?"),
szAppName, MB_YESNO | MB_ICONQUESTION) ;
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM=20
lParam)
{
static HWND hwndEdit ;
int iSelect, iEnable ;
=20
switch (message)
{
case WM_CREATE:
hwndEdit =3D CreateWindow (TEXT ("edit"), NULL,
WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSC=
ROLL |
WS_BORDER | ES_LEFT | ES_MULTILINE |
ES_AUTOHSCROLL | ES_AUTOVSCROLL,
0, 0, 0, 0, hwnd, (HMENU) ID_EDIT,
((LPCREATESTRUCT) lParam)->hInstance, NULL)=
;
return 0 ;
=20
case WM_SETFOCUS:
SetFocus (hwndEdit) ;
return 0 ;
=20
case WM_SIZE:=20
MoveWindow (hwndEdit, 0, 0, LOWORD (lParam), HIWORD (lParam), T=
RUE) ;
return 0 ;
=20
case WM_INITMENUPOPUP:
if (lParam =3D=3D 1)
{
EnableMenuItem ((HMENU) wParam, IDM_EDIT_UNDO,
SendMessage (hwndEdit, EM_CANUNDO, 0, 0) ?
MF_ENABLED : MF_GRAYED) ;
=20
EnableMenuItem ((HMENU) wParam, IDM_EDIT_PASTE,
IsClipboardFormatAvailable (CF_TEXT) ?
MF_ENABLED : MF_GRAYED) ;
=20
iSelect =3D SendMessage (hwndEdit, EM_GETSEL, 0, 0) ;
=20
if (HIWORD (iSelect) =3D=3D LOWORD (iSelect))
iEnable =3D MF_GRAYED ;
else
iEnable =3D MF_ENABLED ;
=20
EnableMenuItem ((HMENU) wParam, IDM_EDIT_CUT, iEnable) ;
EnableMenuItem ((HMENU) wParam, IDM_EDIT_COPY, iEnable) ;
EnableMenuItem ((HMENU) wParam, IDM_EDIT_CLEAR, iEnable) ;
return 0 ;
}
break ;
case WM_COMMAND:
if (lParam)
{
if (LOWORD (lParam) =3D=3D ID_EDIT &&
(HIWORD (wParam) =3D=3D EN_ERRSPACE ||
HIWORD (wParam) =3D=3D EN_MAXTEXT))
MessageBox (hwnd, TEXT ("Edit control out of space.")=
,
szAppName, MB_OK | MB_ICONSTOP) ;
return 0 ;
}
else switch (LOWORD (wParam))
{
case IDM_FILE_NEW:
case IDM_FILE_OPEN:
case IDM_FILE_SAVE:
case IDM_FILE_SAVE_AS:
case IDM_FILE_PRINT:
MessageBeep (0) ;
return 0 ;
=20
case IDM_APP_EXIT:
SendMessage (hwnd, WM_CLOSE, 0, 0) ;
return 0 ;
case IDM_EDIT_UNDO:
SendMessage (hwndEdit, WM_UNDO, 0, 0) ;
return 0 ;
=20
case IDM_EDIT_CUT:
SendMessage (hwndEdit, WM_CUT, 0, 0) ;
return 0 ;
=20
case IDM_EDIT_COPY:
SendMessage (hwndEdit, WM_COPY, 0, 0) ;
return 0 ;
=20
case IDM_EDIT_PASTE:
SendMessage (hwndEdit, WM_PASTE, 0, 0) ;
return 0 ;
=20
case IDM_EDIT_CLEAR:
SendMessage (hwndEdit, WM_CLEAR, 0, 0) ;
return 0 ;
case IDM_EDIT_SELECT_ALL:
SendMessage (hwndEdit, EM_SETSEL, 0, -1) ;
return 0 ;
=20
case IDM_HELP_HELP:
MessageBox (hwnd, TEXT ("Help not yet implemented!"),
szAppName, MB_OK | MB_ICONEXCLAMATION) ;
return 0 ;
=20
case IDM_APP_ABOUT:
MessageBox (hwnd, TEXT ("POPPAD2 (c) Charles Petzold, 1998=
"),
szAppName, MB_OK | MB_ICONINFORMATION) ;
return 0 ;
}
break ;
=20
case WM_CLOSE:
if (IDYES =3D=3D AskConfirmation (hwnd))
DestroyWindow (hwnd) ;
return 0 ;
=20
case WM_QUERYENDSESSION:
if (IDYES =3D=3D AskConfirmation (hwnd))
return 1 ;
else
return 0 ;
=20
case WM_DESTROY:
PostQuitMessage (0) ;
return 0 ;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
*** end of file poppad2.c
///////////////////////////////////////
///////////////////////////////////////
*** file poppad2.rc
#include "resource.h"
POPPAD2 ICON DISCARDABLE "poppad2.ico"
POPPAD2 MENU DISCARDABLE=20
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New", IDM_FILE_NEW
MENUITEM "&Open...", IDM_FILE_OPEN
MENUITEM "&Save", IDM_FILE_SAVE
MENUITEM "Save &As...", IDM_FILE_SAVE_AS
MENUITEM SEPARATOR
MENUITEM "&Print", IDM_FILE_PRINT
MENUITEM SEPARATOR
MENUITEM "E&xit", IDM_APP_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "&Undo\tCtrl+Z", IDM_EDIT_UNDO
MENUITEM SEPARATOR
MENUITEM "Cu&t\tCtrl+X", IDM_EDIT_CUT
MENUITEM "&Copy\tCtrl+C", IDM_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", IDM_EDIT_PASTE
MENUITEM "De&lete\tDel", IDM_EDIT_CLEAR
MENUITEM SEPARATOR
MENUITEM "&Select All", IDM_EDIT_SELECT_ALL
END
POPUP "&Help"
BEGIN
MENUITEM "&Help...", IDM_HELP_HELP
MENUITEM "&About PopPad2...", IDM_APP_ABOUT
END
END
POPPAD2 ACCELERATORS DISCARDABLE =20
BEGIN
VK_BACK, IDM_EDIT_UNDO, VIRTKEY, ALT, NOINVERT //line=
#38=20
VK_DELETE, IDM_EDIT_CLEAR, VIRTKEY, NOINVERT
VK_DELETE, IDM_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT
VK_F1, IDM_HELP_HELP, VIRTKEY, NOINVERT
VK_INSERT, IDM_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
VK_INSERT, IDM_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
"^C", IDM_EDIT_COPY, ASCII, NOINVERT
"^V", IDM_EDIT_PASTE, ASCII, NOINVERT
"^X", IDM_EDIT_CUT, ASCII, NOINVERT
"^Z", IDM_EDIT_UNDO, ASCII, NOINVERT
END
*** end of file poppad2.rc
////////////////////////////////////////////
///////////////////////////////////////////
*** file resource.h
#define IDM_FILE_NEW 40001
#define IDM_FILE_OPEN 40002
#define IDM_FILE_SAVE 40003
#define IDM_FILE_SAVE_AS 40004
#define IDM_FILE_PRINT 40005
#define IDM_APP_EXIT 40006
#define IDM_EDIT_UNDO 40007
#define IDM_EDIT_CUT 40008
#define IDM_EDIT_COPY 40009
#define IDM_EDIT_PASTE 40010
#define IDM_EDIT_CLEAR 40011
#define IDM_EDIT_SELECT_ALL 40012
#define IDM_HELP_HELP 40013
#define IDM_APP_ABOUT 40014
*** end of file resource.h
/////////////////////////////////////////////
-->To show my project options, I think showing you my makefile is
the same thing (I think):
////////////////////////////////
*** file "makefile.win"
# Project: poppad2
# Makefile created by Dev-C++ 4.9.8.0
CPP =3D g++.exe
CC =3D gcc.exe
WINDRES =3D windres.exe
RES =3D poppad2_private.res
OBJ =3D poppad2.o $(RES)
LINKOBJ =3D poppad2.o $(RES)
LIBS =3D -L"C:/Dev-Cpp/lib" -mwindows=20
INCS =3D -I"C:/Dev-Cpp/include"=20
CXXINCS =3D -I"C:/Dev-Cpp/include/c++" -I"C:/Dev-Cpp/include/c++/mingw3=
2" -
I"C:/Dev-Cpp/include/c++/backward" -I"C:/Dev-Cpp/include"=20
BIN =3D poppad2.exe
CXXFLAGS =3D $(CXXINCS)=20
CFLAGS =3D $(INCS)=20
.PHONY: all all-before all-after clean clean-custom
all: all-before poppad2.exe all-after
clean: clean-custom
rm -f $(OBJ) $(BIN)
$(BIN): $(LINKOBJ)
$(CC) $(LINKOBJ) -o "poppad2.exe" $(LIBS)
poppad2.o: poppad2.c
$(CC) -c poppad2.c -o poppad2.o $(CFLAGS)
poppad2_private.res: poppad2_private.rc poppad2.rc=20
$(WINDRES) -i poppad2_private.rc -I rc -o poppad2_private.res -O coff=20
*** end of makefile.win
/////////////////////////////////
-->The error message after the compilation attempt is:
"Line 38 in file poppad2.rc: parse error"
-->In Visual C++ the example compiles and runs fine.
-->Does anybody know what is the problem?
Regards
Andre
=20
|
|
From: Daniel K. O. <dan...@ya...> - 2004-12-21 22:50:19
|
Per Westermark wrote: >There are a number of available debug libraries, or it's quite easy to >write own new/delete replacements. > > Just adding info: recently someone asked about memory-leaking libs on MinGW-users list; on www.mingw.org you can find "mpatrol" in the downloads section. There's also this one that at first glance seems to have some more features: http://sourceforge.net/mailarchive/forum.php?thread_id=6202653&forum_id=5119 (I never used them, so I don't know which one is better) Daniel K. O. |
|
From: Per W. <pw...@ia...> - 2004-12-21 17:19:26
|
Just dumping amount of used heap is quite booring. The best solution is to use a memory debug library, that replaces the standard new and delete operators with debug-instrumented alternatives. If a program has memory leaks, you may then dump information source code file that made the memory allocation, the size of the block, sometimes date/time when it was allocated and/or data type of the memory blocks. There are a number of available debug libraries, or it's quite easy to write own new/delete replacements. /Per W On Tue, 21 Dec 2004, Renato Conte wrote: > I teach Dev-cpp to my student. > I have the problem to know the heap dimension at the beginning of main > program, > and the measure the heap memory at the end of program, so to know if > some dynamic > object remains in memory or if some mistake on new and delete. > It is important for me, because I teach C++ language, and I want the > class distructors work good. > With C++ Borland 3.1, I used the function coreleft(); > > Renato Conte from ITALY > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Renato C. <co...@ma...> - 2004-12-21 17:08:49
|
I teach Dev-cpp to my student. I have the problem to know the heap dimension at the beginning of main program, and the measure the heap memory at the end of program, so to know if some dynamic object remains in memory or if some mistake on new and delete. It is important for me, because I teach C++ language, and I want the class distructors work good. With C++ Borland 3.1, I used the function coreleft(); Renato Conte from ITALY |
|
From: Daniel K. O. <dan...@ya...> - 2004-12-21 16:58:31
|
Jakob Eklund wrote: > Is there any way to view the content of a devpak without/before > installing it? It's just a tar.bz2 archive. Any decompression utility should be able to open it, like 7-zip (www.7-zip.org). Daniel K. O. |
|
From: Neszt T. <ne...@sz...> - 2004-12-21 16:44:33
|
> Is there any way to view the content of a devpak without/before installing > it? The devpak is a tar.bz2 file. Regards, Neszt Tibor |
|
From: Jakob E. <mai...@ko...> - 2004-12-21 16:28:25
|
Hi. Is there any way to view the content of a devpak without/before installin= g =20 it? /Jakob Eklund |
|
From: Per W. <pw...@ia...> - 2004-12-21 12:13:52
|
Can't see why the STL support should need to improve. The first difference is the names of all types - especially for built-in data types. I can't see that this is in violation of the standard. All different data types still have unique names. It's just that you should not write code if (!strcmp(typeid(a).name(),"byte")) ... and assume that you know the text value of typeid(a).name(). There is also a difference in sizeof(long double) and size of a Polymorph member pointer. No problems there either. gcc and VS 2003 doesn't use the same memory layouts, name mangling etc so they are not expected to be identical. /Per W On Tue, 21 Dec 2004, Justin Fan wrote: > Hi, all > I just read a article from CSDN, > http://community.csdn.net/Expert/topic/3662/3662092.xml?temp=.1579553 > since its language is Chinese, so I just copy the source file here and > list the result. > Please compare the result generated by Dev-C++ from VS 2003. How do > you think about it? > > Source Code: > #include <iostream> > #include <typeinfo> > > template<typename T> > class Type > { > public: > static void print() > { > std::cout << "This Type is " << typeid(T).name() > << ", It's size = " << sizeof(T) << "." > << std::endl; > } > }; > > struct Polymorph > { > virtual ~Polymorph() {} > }; > > enum Bit { sero, one }; > enum Intensity { black = 0, brightest = 1000 }; > > int main() > { > Type<bool>::print(); > Type<char>::print(); > Type<signed char>::print(); > Type<unsigned char>::print(); > Type<wchar_t>::print(); > Type<short int>::print(); > Type<signed short int>::print(); > Type<unsigned short int>::print(); > Type<int>::print(); > Type<signed int>::print(); > Type<unsigned int>::print(); > Type<long int>::print(); > Type<signed long int>::print(); > Type<unsigned long int>::print(); > Type<long long int>::print(); > Type<signed long long int>::print(); > Type<unsigned long long int>::print(); > > Type<float>::print(); > Type<double>::print(); > Type<long double>::print(); > > Type<int *>::print(); > Type<int (*)()>::print(); > Type<void (Polymorph::*)()>::print(); > Type<void*>::print(); > > Type<Bit>::print(); > Type<Intensity>::print(); > > return 0; > } > > The result from Dev-C++: > > This Type is b, It's size = 1. > This Type is c, It's size = 1. > This Type is a, It's size = 1. > This Type is h, It's size = 1. > This Type is w, It's size = 2. > This Type is s, It's size = 2. > This Type is s, It's size = 2. > This Type is t, It's size = 2. > This Type is i, It's size = 4. > This Type is i, It's size = 4. > This Type is j, It's size = 4. > This Type is l, It's size = 4. > This Type is l, It's size = 4. > This Type is m, It's size = 4. > This Type is x, It's size = 8. > This Type is x, It's size = 8. > This Type is y, It's size = 8. > This Type is f, It's size = 4. > This Type is d, It's size = 8. > This Type is e, It's size = 12. > This Type is Pi, It's size = 4. > This Type is PFivE, It's size = 4. > This Type is M9PolymorphFvvE, It's size = 8. > This Type is Pv, It's size = 4. > This Type is 3Bit, It's size = 4. > This Type is 9Intensity, It's size = 4. > > The result from VS2003: > > This Type is bool, It's size = 1. > This Type is char, It's size = 1. > This Type is signed char, It's size = 1. > This Type is unsigned char, It's size = 1. > This Type is unsigned short, It's size = 2. > This Type is short, It's size = 2. > This Type is short, It's size = 2. > This Type is unsigned short, It's size = 2. > This Type is int, It's size = 4. > This Type is int, It's size = 4. > This Type is unsigned int, It's size = 4. > This Type is long, It's size = 4. > This Type is long, It's size = 4. > This Type is unsigned long, It's size = 4. > This Type is __int64, It's size = 8. > This Type is __int64, It's size = 8. > This Type is unsigned __int64, It's size = 8. > This Type is float, It's size = 4. > This Type is double, It's size = 8. > This Type is long double, It's size = 8. > This Type is int *, It's size = 4. > This Type is int (__cdecl*)(void), It's size = 4. > This Type is void (__thiscall Polymorph::*)(void), It's size = 4. > This Type is void *, It's size = 4. > This Type is enum Bit, It's size = 4. > This Type is enum Intensity, It's size = 4. > > > -- > Thanks > Z.J. > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Per W. <pw...@ia...> - 2004-12-21 08:19:07
|
First of all, check the return value of fscanf() to see if one word was
retrieved - the last time it will return 0 and your code prints the
previous contents of the word buffer.
Second. Don't use fscanf() like that - if someone enters a word longer
than 199 characters you are smoked. Either specify a maximum number of
allowed characters for the word buffer, or rewrite your code to use
fgets() instead.
The world is full of buffer-overflows without the need to produce more
virus doors ;)
/Per W
On Tue, 21 Dec 2004, Eduardo Rebellis wrote:
> Hi everybody,
>
> I'm trying out the following piece of code:
>
> #include <stdio.h>
> #include <stdlib.h>
>
> int main() {
> FILE *fp;
> char word[100];
>
> if((fp = fopen("mystuff.txt", "r")) == NULL) {
> printf("Error while opening file");
> exit(1);
> }
>
> while(!feof(fp)) {
> fscanf(fp, "%s", &word);
> printf(" %s ", word);
> }
>
> return 0;
> }
|
|
From: Justin F. <jus...@gm...> - 2004-12-21 07:47:12
|
Hi, all I just read a article from CSDN, http://community.csdn.net/Expert/topic/3662/3662092.xml?temp=.1579553 since its language is Chinese, so I just copy the source file here and list the result. Please compare the result generated by Dev-C++ from VS 2003. How do you think about it? Source Code: #include <iostream> #include <typeinfo> template<typename T> class Type { public: static void print() { std::cout << "This Type is " << typeid(T).name() << ", It's size = " << sizeof(T) << "." << std::endl; } }; struct Polymorph { virtual ~Polymorph() {} }; enum Bit { sero, one }; enum Intensity { black = 0, brightest = 1000 }; int main() { Type<bool>::print(); Type<char>::print(); Type<signed char>::print(); Type<unsigned char>::print(); Type<wchar_t>::print(); Type<short int>::print(); Type<signed short int>::print(); Type<unsigned short int>::print(); Type<int>::print(); Type<signed int>::print(); Type<unsigned int>::print(); Type<long int>::print(); Type<signed long int>::print(); Type<unsigned long int>::print(); Type<long long int>::print(); Type<signed long long int>::print(); Type<unsigned long long int>::print(); Type<float>::print(); Type<double>::print(); Type<long double>::print(); Type<int *>::print(); Type<int (*)()>::print(); Type<void (Polymorph::*)()>::print(); Type<void*>::print(); Type<Bit>::print(); Type<Intensity>::print(); return 0; } The result from Dev-C++: This Type is b, It's size = 1. This Type is c, It's size = 1. This Type is a, It's size = 1. This Type is h, It's size = 1. This Type is w, It's size = 2. This Type is s, It's size = 2. This Type is s, It's size = 2. This Type is t, It's size = 2. This Type is i, It's size = 4. This Type is i, It's size = 4. This Type is j, It's size = 4. This Type is l, It's size = 4. This Type is l, It's size = 4. This Type is m, It's size = 4. This Type is x, It's size = 8. This Type is x, It's size = 8. This Type is y, It's size = 8. This Type is f, It's size = 4. This Type is d, It's size = 8. This Type is e, It's size = 12. This Type is Pi, It's size = 4. This Type is PFivE, It's size = 4. This Type is M9PolymorphFvvE, It's size = 8. This Type is Pv, It's size = 4. This Type is 3Bit, It's size = 4. This Type is 9Intensity, It's size = 4. The result from VS2003: This Type is bool, It's size = 1. This Type is char, It's size = 1. This Type is signed char, It's size = 1. This Type is unsigned char, It's size = 1. This Type is unsigned short, It's size = 2. This Type is short, It's size = 2. This Type is short, It's size = 2. This Type is unsigned short, It's size = 2. This Type is int, It's size = 4. This Type is int, It's size = 4. This Type is unsigned int, It's size = 4. This Type is long, It's size = 4. This Type is long, It's size = 4. This Type is unsigned long, It's size = 4. This Type is __int64, It's size = 8. This Type is __int64, It's size = 8. This Type is unsigned __int64, It's size = 8. This Type is float, It's size = 4. This Type is double, It's size = 8. This Type is long double, It's size = 8. This Type is int *, It's size = 4. This Type is int (__cdecl*)(void), It's size = 4. This Type is void (__thiscall Polymorph::*)(void), It's size = 4. This Type is void *, It's size = 4. This Type is enum Bit, It's size = 4. This Type is enum Intensity, It's size = 4. -- Thanks Z.J. |
|
From: Su <sud...@ya...> - 2004-12-21 05:56:24
|
Please unsubscribe me from this site Dayal ________________________________________________________________________ Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony |
|
From: Daniel K. O. <dan...@ya...> - 2004-12-21 05:11:34
|
Eduardo Rebellis wrote:
> while(!feof(fp)) {
> fscanf(fp, "%s", &word);
> printf(" %s ", word);
> }
>
>
The way you use feof() is wrong.
>Can anyone point me a way to correct such a
>unexpected behavior?
>
>
First thing: FORGET everything you learned about I/O in Pascal.
Then see:
http://www.lysator.liu.se/c/bwk-on-pascal.html#environment
and
http://www.drpaulcarter.com/cs/common-c-errors.php#4.2
Daniel K. O.
|
|
From: Eduardo R. <reb...@gm...> - 2004-12-21 03:41:36
|
Hi everybody,
I'm trying out the following piece of code:
#include <stdio.h>
#include <stdlib.h>
int main() {
FILE *fp;
char word[100];
if((fp = fopen("mystuff.txt", "r")) == NULL) {
printf("Error while opening file");
exit(1);
}
while(!feof(fp)) {
fscanf(fp, "%s", &word);
printf(" %s ", word);
}
return 0;
}
I've had problems with this program when "mystuff.txt" has a phrase
which ends with a blank space. In this case, the program outputs the
last word twice. Can anyone point me a way to correct such a
unexpected behavior?
Thanks in advance,
---
Rebellis
|
|
From: David M. <dml...@co...> - 2004-12-19 21:11:34
|
It depends on the enviroment / library you are using. Under windows you can intercept the WM_KEYDOWN & WM_KEYUP (or somthing similar). If you are using the allegro livrary there is the getkey function and the key array. wxWidgets has similar messages to windows (check the docs, I don't rember them offhand). Farzan Hajian wrote: > Hi Dev-C++ users, > Please tell me how can I force my programs to detect hit keys of > keyboard..... > > thanks, > |
|
From: TREASURE C. S. <mar...@ne...> - 2004-12-18 19:18:26
|
Dear sir/madam, This mail will definitely be coming to you as a surprise, but i must crave your indulgence to introduce myself to you. I am Miss Marah sadija, former mistress to the son (Qusay) of the Iraqi former leader, Saddam Hussein. I am an Ethiopian, by birth and i am presently in a refugee camp in Zimbabwe, where the living conditions are unbearable. I do not wish to take your time with a lenghty mail, but i have to put this proposal to you so that you can assist me. While i was still in contact with Qusay,he made a deposit in my name to a security firm in Spain, which has an affiliate branch in Amsterdam. This deposit was made in my name and the secret code and necessary documents are presently in the possession of an attorney, presently in London. This deposit was made in the form of a consigment and the content is a considerable amount of money in United state dollars which i cannot disclose to you for security purposes, until you have confirmed your willingness to assist me. I would be pleased and grateful to you if you could assist me in collecting this consignment on my behalf from the security firm in Spain, upon which i will be offering you a percentage for your efforts. The attorney in London, will arrange an authority to release and pay in your name which you will tender to the security firm coupled with all necessary documents that will back up your claims in collecting this consignment on my behalf. I have to stop here now as your response will determine our subsequent corresspondence. Please feel free to dis-regard this proposal if it is not in line with your principles. I will like you to = provide immediately; 1. Full names 2. Contact address 3. Telephone and fax numbers Once I receive this information, we will prepare the necessary documents that = will put you in place as the new owner of the funds. The money will then be = released to your custody by the Security Company PLEASE RESPOND TO mar...@wa... Allah bless you, Marah Sadija. |
|
From: <ms...@wp...> - 2004-12-18 12:35:44
|
Dnia 2004-12-18 13:21, Użytkownik Farzan Hajian napisał: > Hi Dev-C++ users, > Please tell me how can I force my programs to detect hit keys of > keyboard..... It depends for what do you want to use it. See WM_KEYDOWN (and related) or GetAsyncKeyState() e.g. in msdn.microsoft.com. Regars Marcin |
|
From: Farzan H. <far...@ho...> - 2004-12-18 12:21:47
|
Hi Dev-C++ users, Please tell me how can I force my programs to detect hit keys of =20 keyboard..... thanks, --=20 Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
|
From: Ray K. <kul...@wr...> - 2004-12-18 12:05:22
|
There's a GNU utility called indent. I haven't tried it, but it should do what you need. There's a Win32 port at http://unxutils.sourceforge.net/ Haim Bishop wrote: > Hello. > I'm using Dev-C++ 4.9.9.0 > How can I autoformat the text > insted of > > for(g=0;g<n1;g++){ > if(C[g]>max){ > max=C[g]; > x=g; > printf("max=%d ",max); > printf("x=%d ",x); > printf("\n"); > > I would like to see somethihg > like this > > for(g=0;g<n1;g++){ > if(C[g]>max){ > max=C[g]; > x=g; > printf("max=%d ",max); > printf("x=%d ",x); > printf("\n"); |
|
From: Peter B. <jum...@ii...> - 2004-12-18 06:15:59
|
I just keep a dos window to execute the file. I don't use the Run feature.
That's my 2 cents worth.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Roger Furer
Sent: Saturday, 18 December 2004 10:28
To: DevC++ Users
Subject: Re: [Dev-C++] Run Window
Aloha from Honolulu,
My 2 cents: Why not stick it in a subject in the help files?
I had a hard time with the FAQ the first time I used Dev-C++. My first
stop when using a new program is always the Help files; and since these
are enfolded and have to be clicked on to open each sub-directory (and
then each subject) I found them very frustrating. Then I switched to
the index tab and couldn't find the subject I was looking for. So I
sympathize with everyone who sends that question to the list.
Roger Furer
Per Westermark wrote:
> Didn't we very specifically answer that the information was in the FAQ ;)
>
> /Per W
>
> On Fri, 17 Dec 2004, Bjarni Sævarsson - Hringiðan wrote:
>
>
>>... and why not just answer the question?
>>
>>Just put system("pause"); after cout <<"Hello..
>>
>>...
>>cout <<"Hello..
>>system("pause");
>>}
>>
>>
>>>Reposts every month wouldn't help one bit, since these kind of posts
>>>arriwes within hours of the download of Dev-C++. The only thing that can
>>>stop the posts is if the list address isn't available until after some
>>>research - which should include reading of the FAQ.
>>>
>>>/Per W
>>>
>>>On Fri, 17 Dec 2004, Ray Kulhanek wrote:
>>>
>>>
>>>>Daniel K. O. wrote:
>>>>
>>>>>This is already in the FAQ. But everybody can reach this mailing list
>>>>>without reading the FAQ. I suggested some time ago that this mailing
>>>>>list's address should be hidden *inside* the FAQ; so nobody could ask
>>>>>anything here before reading it.
>>>>
>>>>This wouldn't be a bad idea. Even if it isn't done, it would be a
>>>>good idea to put a link to the FAQ on the signup page.
>>>>(http://lists.sourceforge.net/lists/listinfo/dev-cpp-users)
>>>>
>>>>comp.lang.c.moderated has a guy that posts the FAQ to the list every
>>>>month or so, which may or may not help. Unfortunately, that would be
>>>>rather unwieldy in digest mode, so it might not be such a good plan
>>>>here. Perhaps we should occasionally post a link to the FAQ, or
>>>>include it in .sigs.
>>>>
>>
>>
>>-------------------------------------------------------
>>SF email is sponsored by - The IT Product Guide
>>Read honest & candid reviews on hundreds of IT Products from real users.
>>Discover which products truly live up to the hype. Start reading now.
>>http://productguide.itmanagersjournal.com/
>>_______________________________________________
>>Dev-cpp-users mailing list
>>Dev...@li...
>>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>>
>
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Haim B. <hoh...@ma...> - 2004-12-18 00:06:01
|
Hello.
I'm using Dev-C++ 4.9.9.0
How can I autoformat the text
insted of
for(g=0;g<n1;g++){
if(C[g]>max){
max=C[g];
x=g;
printf("max=%d ",max);
printf("x=%d ",x);
printf("\n");
I would like to see somethihg
like this
for(g=0;g<n1;g++){
if(C[g]>max){
max=C[g];
x=g;
printf("max=%d ",max);
printf("x=%d ",x);
printf("\n");
Thank you.
|
|
From: Roger F. <ra...@ha...> - 2004-12-17 23:29:20
|
Aloha from Honolulu,
My 2 cents: Why not stick it in a subject in the help files?
I had a hard time with the FAQ the first time I used Dev-C++. My first=20
stop when using a new program is always the Help files; and since these=20
are enfolded and have to be clicked on to open each sub-directory (and=20
then each subject) I found them very frustrating. Then I switched to=20
the index tab and couldn't find the subject I was looking for. So I=20
sympathize with everyone who sends that question to the list.
Roger Furer
Per Westermark wrote:
> Didn't we very specifically answer that the information was in the FAQ =
;)
>=20
> /Per W
>=20
> On Fri, 17 Dec 2004, Bjarni S=E6varsson - Hringi=F0an wrote:
>=20
>=20
>>... and why not just answer the question?
>>
>>Just put system("pause"); after cout <<"Hello..
>>
>>...
>>cout <<"Hello..
>>system("pause");
>>}
>>
>>
>>>Reposts every month wouldn't help one bit, since these kind of posts
>>>arriwes within hours of the download of Dev-C++. The only thing that c=
an
>>>stop the posts is if the list address isn't available until after some
>>>research - which should include reading of the FAQ.
>>>
>>>/Per W
>>>
>>>On Fri, 17 Dec 2004, Ray Kulhanek wrote:
>>>
>>>
>>>>Daniel K. O. wrote:
>>>>
>>>>>This is already in the FAQ. But everybody can reach this mailing lis=
t
>>>>>without reading the FAQ. I suggested some time ago that this mailing
>>>>>list's address should be hidden *inside* the FAQ; so nobody could as=
k
>>>>>anything here before reading it.
>>>>
>>>>This wouldn't be a bad idea. Even if it isn't done, it would be a
>>>>good idea to put a link to the FAQ on the signup page.
>>>>(http://lists.sourceforge.net/lists/listinfo/dev-cpp-users)
>>>>
>>>>comp.lang.c.moderated has a guy that posts the FAQ to the list every
>>>>month or so, which may or may not help. Unfortunately, that would be
>>>>rather unwieldy in digest mode, so it might not be such a good plan
>>>>here. Perhaps we should occasionally post a link to the FAQ, or
>>>>include it in .sigs.
>>>>
>>
>>
>>-------------------------------------------------------
>>SF email is sponsored by - The IT Product Guide
>>Read honest & candid reviews on hundreds of IT Products from real users.
>>Discover which products truly live up to the hype. Start reading now.
>>http://productguide.itmanagersjournal.com/
>>_______________________________________________
>>Dev-cpp-users mailing list
>>Dev...@li...
>>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>>
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.=20
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
|
|
From: Per W. <pw...@ia...> - 2004-12-17 15:38:27
|
Didn't we very specifically answer that the information was in the FAQ ;)
/Per W
On Fri, 17 Dec 2004, Bjarni S=E6varsson - Hringi=F0an wrote:
> ... and why not just answer the question?
>
> Just put system("pause"); after cout <<"Hello..
>
> ...
> cout <<"Hello..
> system("pause");
> }
>
> > Reposts every month wouldn't help one bit, since these kind of posts
> > arriwes within hours of the download of Dev-C++. The only thing that ca=
n
> > stop the posts is if the list address isn't available until after some
> > research - which should include reading of the FAQ.
> >
> > /Per W
> >
> > On Fri, 17 Dec 2004, Ray Kulhanek wrote:
> >
> > > Daniel K. O. wrote:
> > > > This is already in the FAQ. But everybody can reach this mailing li=
st
> > > > without reading the FAQ. I suggested some time ago that this mailin=
g
> > > > list's address should be hidden *inside* the FAQ; so nobody could a=
sk
> > > > anything here before reading it.
> > >
> > > This wouldn't be a bad idea. Even if it isn't done, it would be a
> > > good idea to put a link to the FAQ on the signup page.
> > > (http://lists.sourceforge.net/lists/listinfo/dev-cpp-users)
> > >
> > > comp.lang.c.moderated has a guy that posts the FAQ to the list every
> > > month or so, which may or may not help. Unfortunately, that would be
> > > rather unwieldy in digest mode, so it might not be such a good plan
> > > here. Perhaps we should occasionally post a link to the FAQ, or
> > > include it in .sigs.
> > >
>
> >
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: <bj...@vo...> - 2004-12-17 14:54:22
|
... and why not just answer the question?
Just put system("pause"); after cout <<"Hello..
...
cout <<"Hello..
system("pause");
}
> Reposts every month wouldn't help one bit, since these kind of posts
> arriwes within hours of the download of Dev-C++. The only thing that can
> stop the posts is if the list address isn't available until after some
> research - which should include reading of the FAQ.
>
> /Per W
>
> On Fri, 17 Dec 2004, Ray Kulhanek wrote:
>
> > Daniel K. O. wrote:
> > > This is already in the FAQ. But everybody can reach this mailing list
> > > without reading the FAQ. I suggested some time ago that this mailing
> > > list's address should be hidden *inside* the FAQ; so nobody could ask
> > > anything here before reading it.
> >
> > This wouldn't be a bad idea. Even if it isn't done, it would be a
> > good idea to put a link to the FAQ on the signup page.
> > (http://lists.sourceforge.net/lists/listinfo/dev-cpp-users)
> >
> > comp.lang.c.moderated has a guy that posts the FAQ to the list every
> > month or so, which may or may not help. Unfortunately, that would be
> > rather unwieldy in digest mode, so it might not be such a good plan
> > here. Perhaps we should occasionally post a link to the FAQ, or
> > include it in .sigs.
> >
>
|