dev-cpp-users Mailing List for Dev-C++ (Page 122)
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: Per W. <pw...@ia...> - 2005-07-05 20:13:49
|
Posix don't deal with invalid pointers - only strings pointing to or not
pointing to a directory entry.
They don't need to mention any segmentation faults - it's always up to the
developer to make sure that all pointers are ssane.
/Per W
On Tue, 5 Jul 2005 Mat...@Ve... wrote:
> Not according to Posix... Where are the segfaults in this?
> Also, if you can't check the status of the directory with opendir, try stat.
>
> NAME
>
> opendir - open a directory
>
> SYNOPSIS
>
> #include <dirent.h>
>
> DIR *opendir(const char *dirname);
>
> DESCRIPTION
>
> The opendir() function shall open a directory stream corresponding to
> the directory named by the dirname argument. The directory stream is
> positioned at the first entry. If the type DIR is implemented using a file
> descriptor, applications shall only be able to open up to a total of
> {OPEN_MAX} files and directories.
>
> RETURN VALUE
>
> Upon successful completion, opendir() shall return a pointer to an
> object of type DIR. Otherwise, a null pointer shall be returned and errno
> set to indicate the error.
>
> ERRORS
>
> The opendir() function shall fail if:
>
> [EACCES]
> Search permission is denied for the component of the path prefix of
> dirname or read permission is denied for dirname.
> [ELOOP]
> A loop exists in symbolic links encountered during resolution of the
> dirname argument.
> [ENAMETOOLONG]
> The length of the dirname argument exceeds {PATH_MAX} or a pathname
> component is longer than {NAME_MAX}.
> [ENOENT]
> A component of dirname does not name an existing directory or
> dirname is an empty string.
> [ENOTDIR]
> A component of dirname is not a directory.
>
> The opendir() function may fail if:
>
> [ELOOP]
> More than {SYMLOOP_MAX} symbolic links were encountered during
> resolution of the dirname argument.
> [EMFILE]
> {OPEN_MAX} file descriptors are currently open in the calling
> process.
> [ENAMETOOLONG]
> As a result of encountering a symbolic link in resolution of the
> dirname argument, the length of the substituted pathname string exceeded
> {PATH_MAX}.
> [ENFILE]
> Too many files are currently open in the system.
>
>
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...]On Behalf Of Big
> Playah
> Sent: Monday, July 04, 2005 5:32 AM
> To: dev...@li...
> Subject: Re: > Subject: Re: [Dev-C++] directory I/O handling problem
>
>
> Hi,
>
> > Message: 5
> > Date: Sat, 2 Jul 2005 21:18:24 -0500
> > From: Josh McFarlane <da...@gm...>
> > Reply-To: Josh McFarlane <da...@gm...>
> > Subject: Re: [Dev-C++] directory I/O handling problem
> > Cc: dev...@li...
>
> > Why not just call opendir() and check for a null pointer after calling it?
>
> because it raises some segfaults with stupid arguments which might
> happen... that's what I want to avoid
>
> tom
> ___________________________________________________________________
> The information contained in this message and any attachment may be
> proprietary, confidential, and privileged or subject to the work
> product doctrine and thus protected from disclosure. If the reader
> of this message is not the intended recipient, or an employee or
> agent responsible for delivering this message to the intended
> recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited.
> If you have received this communication in error, please notify me
> immediately by replying to this message and deleting it and all
> copies and backups thereof. Thank you.
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> 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: Jonathan D. <gri...@ho...> - 2005-07-05 19:41:56
|
Has this problem been addressed before? In Dev-C++ 4.9.9.2, it can mess with your program if you use the character '\' within a comment. I haven't had formal programming instruction, but I have seen this usage in a program compiled by another compiler (probably VC++), so I don't think it's supposed to be a no-no. Can this be fixed so nobody else needs to spend wasted time finding this problem in their program? _________________________________________________________________ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ |
|
From: <Mat...@Ve...> - 2005-07-05 18:04:42
|
Not according to Posix... Where are the segfaults in this?
Also, if you can't check the status of the directory with opendir, try stat.
NAME
opendir - open a directory
SYNOPSIS
#include <dirent.h>
DIR *opendir(const char *dirname);
DESCRIPTION
The opendir() function shall open a directory stream corresponding to
the directory named by the dirname argument. The directory stream is
positioned at the first entry. If the type DIR is implemented using a file
descriptor, applications shall only be able to open up to a total of
{OPEN_MAX} files and directories.
RETURN VALUE
Upon successful completion, opendir() shall return a pointer to an
object of type DIR. Otherwise, a null pointer shall be returned and errno
set to indicate the error.
ERRORS
The opendir() function shall fail if:
[EACCES]
Search permission is denied for the component of the path prefix of
dirname or read permission is denied for dirname.
[ELOOP]
A loop exists in symbolic links encountered during resolution of the
dirname argument.
[ENAMETOOLONG]
The length of the dirname argument exceeds {PATH_MAX} or a pathname
component is longer than {NAME_MAX}.
[ENOENT]
A component of dirname does not name an existing directory or
dirname is an empty string.
[ENOTDIR]
A component of dirname is not a directory.
The opendir() function may fail if:
[ELOOP]
More than {SYMLOOP_MAX} symbolic links were encountered during
resolution of the dirname argument.
[EMFILE]
{OPEN_MAX} file descriptors are currently open in the calling
process.
[ENAMETOOLONG]
As a result of encountering a symbolic link in resolution of the
dirname argument, the length of the substituted pathname string exceeded
{PATH_MAX}.
[ENFILE]
Too many files are currently open in the system.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Big
Playah
Sent: Monday, July 04, 2005 5:32 AM
To: dev...@li...
Subject: Re: > Subject: Re: [Dev-C++] directory I/O handling problem
Hi,
> Message: 5
> Date: Sat, 2 Jul 2005 21:18:24 -0500
> From: Josh McFarlane <da...@gm...>
> Reply-To: Josh McFarlane <da...@gm...>
> Subject: Re: [Dev-C++] directory I/O handling problem
> Cc: dev...@li...
> Why not just call opendir() and check for a null pointer after calling it?
because it raises some segfaults with stupid arguments which might
happen... that's what I want to avoid
tom
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure. If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof. Thank you.
|
|
From: shaji m. <sha...@gm...> - 2005-07-04 13:37:32
|
Hi, Has anyone tried this before or have ideas about how to solve the problem ? What I want to do: Compile the WMI sample program below (from http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/wmisdk/w= mi/example_creating_a_wmi_application.asp) using Dev-C++ . ---------------------------------------------------------------------------= --------------------------- #define _WIN32_DCOM #include <iostream> using namespace std; #include <comdef.h> #include <Wbemidl.h> # pragma comment(lib, "wbemuuid.lib") int main(int argc, char **argv) { HRESULT hres; // Initialize COM. hres =3D CoInitializeEx(0, COINIT_MULTITHREADED); if (FAILED(hres)) { cout << "Failed to initialize COM library. " << "Error code =3D 0x" << hex << hres << endl; return 1; // Program has failed. } // Initialize hres =3D CoInitializeSecurity( NULL, =20 -1, // COM negotiates service =20 NULL, // Authentication services NULL, // Reserved RPC_C_AUTHN_LEVEL_DEFAULT, // authentication RPC_C_IMP_LEVEL_IMPERSONATE, // Impersonation NULL, // Authentication info EOAC_NONE, // Additional capabilities NULL // Reserved ); =20 if (FAILED(hres)) { cout << "Failed to initialize security. " << "Error code =3D 0x" << hex << hres << endl; CoUninitialize(); return 1; // Program has failed. } // Obtain the initial locator to Windows Management // on a particular host computer. IWbemLocator *pLoc =3D 0; hres =3D CoCreateInstance( CLSID_WbemLocator, =20 0, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID *) &pLoc); =20 if (FAILED(hres)) { cout << "Failed to create IWbemLocator object. " << "Error code =3D 0x" << hex << hres << endl; CoUninitialize(); return 1; // Program has failed. } IWbemServices *pSvc =3D 0; // Connect to the root\cimv2 namespace with the // current user and obtain pointer pSvc // to make IWbemServices calls. hres =3D pLoc->ConnectServer( =20 _bstr_t(L"ROOT\\CIMV2"), // WMI namespace NULL, // User name NULL, // User password 0, // Locale NULL, // Security flags =20 0, // Authority =20 0, // Context object &pSvc // IWbemServices proxy ); =20 =20 if (FAILED(hres)) { cout << "Could not connect. Error code =3D 0x" << hex << hres << endl; pLoc->Release(); =20 CoUninitialize(); return 1; // Program has failed. } cout << "Connected to ROOT\\CIMV2 WMI namespace" << endl; // Set the IWbemServices proxy so that impersonation // of the user (client) occurs. hres =3D CoSetProxyBlanket( =20 pSvc, // the proxy to set RPC_C_AUTHN_WINNT, // authentication service RPC_C_AUTHZ_NONE, // authorization service NULL, // Server principal name RPC_C_AUTHN_LEVEL_CALL, // authentication level RPC_C_IMP_LEVEL_IMPERSONATE, // impersonation level NULL, // client identity EOAC_NONE // proxy capabilities =20 ); if (FAILED(hres)) { cout << "Could not set proxy blanket. Error code =3D 0x" << hex << hres << endl; pSvc->Release(); pLoc->Release(); =20 CoUninitialize(); return 1; // Program has failed. } // Use the IWbemServices pointer to make requests of WMI. // Make requests here: // For example, query for print queues that // have more than 10 jobs IEnumWbemClassObject* pEnumerator =3D NULL; hres =3D pSvc->ExecQuery( bstr_t("WQL"), bstr_t("SELECT * Win32_PerfFormattedData_Spooler_PrintQueue " "Where Name <> '_Total'"), WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator); =20 if (FAILED(hres)) { cout << "Query for print queues failed. " << "Error code =3D 0x" << hex << hres << endl; pSvc->Release(); pLoc->Release(); =20 CoUninitialize(); return 1; // Program has failed. } else { do { IWbemClassObject* pInstance =3D NULL; ULONG dwCount =3D NULL; hres =3D pEnumerator->Next( WBEM_INFINITE, 1, &pInstance, &dwCount); =20 =20 } while (hres =3D=3D WBEM_S_NO_ERROR); =20 } =20 // Cleanup // =3D=3D=3D=3D=3D=3D=3D=3D pSvc->Release(); pLoc->Release(); =20 CoUninitialize(); return 0; // Program successfully completed. } ---------------------------------------------------------------------------= --------------------------- What I tried: Installed Dev-C++ 4.9.9.2 on my Windows 2000 machine and tried to compile the program - the compiler complained about not being able to find comdef.h. So downloaded the Windows SDK from MSDN and installed it (From the ISO image 5.2.3790.1830.15.PlatformSDK_Svr2003SP1_rtm.img after burning a CD with it). Added the SDK include and lib directories in the project options. Now the top of the compile log looks like this - the compiler gives me 470 errors ! ---------------------------------------------------------------------------= --------------------------- Compiler: Default compiler Building Makefile: "D:\shaji\projects\WMIsample\Makefile.win" Executing make... make.exe -f "D:\shaji\projects\WMIsample\Makefile.win" all g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"=20 -I"C:/Dev-Cpp/include/c++/3.4.2/backward"=20 -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"=20 -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"=20 -I"C:/Program Files/Microsoft Platform SDK/Include" -I"C:/Program Files/Microsoft Platform SDK/Include/crt" In file included from C:/Program Files/Microsoft Platform SDK/Include/crt/comutil.h:17, from C:/Program Files/Microsoft Platform SDK/Include/comdef.h:23, from main.cpp:4: C:/Program Files/Microsoft Platform SDK/Include/crt/intsafe.h:660:19: invalid suffix "ui64" on integer constant C:/Program Files/Microsoft Platform SDK/Include/crt/intsafe.h:1356:19: invalid suffix "ui64" on integer constant C:/Program Files/Microsoft Platform SDK/Include/crt/intsafe.h:2145:19: invalid suffix "ui64" on integer constant C:/Program Files/Microsoft Platform SDK/Include/crt/intsafe.h:2356:19: invalid suffix "i64" on integer constant C:/Program Files/Microsoft Platform SDK/Include/crt/intsafe.h:2358:23: invalid suffix "i64" on integer constant C:/Program Files/Microsoft Platform SDK/Include/crt/intsafe.h:2769:19: invalid suffix "ui64" on integer constant C:/Program Files/Microsoft Platform SDK/Include/crt/intsafe.h:2937:19: invalid suffix "ui64" on integer constant C:/Program Files/Microsoft Platform SDK/Include/crt/intsafe.h:3105:19: invalid suffix "ui64" on integer constant In file included from C:/Program Files/Microsoft Platform SDK/Include/crt/comutil.h:17, from C:/Program Files/Microsoft Platform SDK/Include/comdef.h:23, from main.cpp:4: C:/Program Files/Microsoft Platform SDK/Include/crt/intsafe.h: In function `HRESULT ULongLongMult(long long unsigned int, long long unsigned int, long long unsigned int*)': C:/Program Files/Microsoft Platform SDK/Include/crt/intsafe.h:3129: error: integer constant is too large for "long" type C:/Program Files/Microsoft Platform SDK/Include/crt/intsafe.h:3135: error: integer constant is too large for "long" type In file included from C:/Program Files/Microsoft Platform SDK/Include/comdef.h:23, from main.cpp:4: C:/Program Files/Microsoft Platform SDK/Include/crt/comutil.h: At global sc= ope: C:/Program Files/Microsoft Platform SDK/Include/crt/comutil.h:45: error: invalid use of undefined type `struct _com_error' ---------------------------------------------------------------------------= --------------------------- I did a Google search for ui64 and came across this in the change log for lcc-win32 (http://www.q-software-solutions.de/products/lcc-win32/change= log.shtml): The compiler now recognizes I64 and UI64 as suffixes equivalent to LL and ULL to remain compatible with Microsoft notation. No warnings were given when a long long constant overflowed. Fixed. Might the compiler in Dev-C++ need changes along these lines ? Or is there some simple solution ? Regards Shaji Mathew |
|
From: Per W. <pw...@ia...> - 2005-07-04 13:13:07
|
A good reason for stat(), opendir() etc. to generate segfaults is if YOU send an invalid file/directory name pointer as parameter. If the pointer isn't valid, it doesn't matter which method you use to try and check for the existence of a directory or file. The OS does it's best to do the correct thing when you send in correct parameters. You have to do your best to make sure your parameters are always correct! /Per W On Mon, 4 Jul 2005, Big Playah wrote: > Hi, > > > Message: 5 > > Date: Sat, 2 Jul 2005 21:18:24 -0500 > > From: Josh McFarlane <da...@gm...> > > Reply-To: Josh McFarlane <da...@gm...> > > Subject: Re: [Dev-C++] directory I/O handling problem > > Cc: dev...@li... > > > Why not just call opendir() and check for a null pointer after calling it? > > because it raises some segfaults with stupid arguments which might > happen... that's what I want to avoid > > tom > > -- > Coupe Quattro '89 > Typ81 custom '84 > > > ---------------------------------- |
|
From: Big P. <big...@gm...> - 2005-07-04 12:32:41
|
Hi, > Message: 5 > Date: Sat, 2 Jul 2005 21:18:24 -0500 > From: Josh McFarlane <da...@gm...> > Reply-To: Josh McFarlane <da...@gm...> > Subject: Re: [Dev-C++] directory I/O handling problem > Cc: dev...@li... > Why not just call opendir() and check for a null pointer after calling it= ? because it raises some segfaults with stupid arguments which might happen... that's what I want to avoid tom --=20 Coupe Quattro '89 Typ81 custom '84 |
|
From: Corona R. <cor...@gm...> - 2005-07-04 09:28:31
|
Hi, How can I access directly the functions of a COM object?I've only the idl file from the ocx. Can also post me a compreensive tutorial? I hope that I'm not OT! Regards and thank's to everyone. --=20 Riccardo Corona |
|
From: lordSauron <lor...@gm...> - 2005-07-04 01:09:26
|
> Its nothing to worry about, just keep going > and use the dev-c++ base code instead of the books, and if it bothers > you or confuses you, try to find a more recent book. Or just ask us. that's why we're here, no? |
|
From: Robert A. <ral...@gm...> - 2005-07-03 14:57:14
|
Two points.... first is everything in computers is binary.. even the Text of this e-mail, everything above that depends on how you interpet the data. (the following excludes unicode which complicates plain text but...read one= ) Even in a 'plain text' file the Text is really ASCII where 'A' is 65, etc.= .. that 65 is not stored are the digit 6 followed by 5 because neither 6 nor 5 are binary.... everything has to be stored as a series of zeros and ones ... usually (and this again depends upon interpetation) they are handled in series of 8 bits ( a series of 8 zeros and/or ones) which allow the binary numbers which correspond to the decimal numbers 0 to 255. So your problem has 3 sub problems... 1 to read the file=20 2 to interpet the data as binary 3 to print it out Focusing on part 2... most of the options to read data will return you a byte (8 bits long) which you will usually work with as a numerical value ranging from 0 to 255. I will assume that you know how to convert from decimal to binary(if you don't let me know and I can explain the two different methods I know...if you can't follow the one you should be able to follow the other). You could do something as simple and as long as a huge if/them/else or preferably CASE statement where you do something like: switch (i) case(0) : std::cout << "00000000" ; break case(1): std::cout << "00000001" ; break ... ... Or you could do someting as complicated as use an algorithm to do a conversion and print out the values as strings.. Or alterbatively there is probably a modifier to std::out to change the output base to binarty... hope this helps, Robert On 7/3/05, Scott <fre...@ve...> wrote: > =20 > Does anyone, or can anyone help me write a simple console app,=20 > to scan a file and dump or display it's contents as "Decimal 1 byte bina= ry" > even just some info, on what i would do to view a file as decimal 1byte..= .=20 > would help,=20 > =20 > i.e=20 > =20 > I want to display or dump to a text file something like...=20 > the following:=20 > ---------------------------------------------------------------- > 00000020 105 100 0 0 76 65=20 > 00000040 84 83 0 0 0 0=20 > 00000060 0 6 86 77 65=20 > ---------------------------------------------------------------- > Anyone have any links, or where i should be looking for more info,=20 > i have done google searches without much luck.=20 > =20 > Thanks,=20 >=20 > Cheers,=20 > Scott.=20 > =20 > =20 > |
|
From: Scott S. <ssi...@sp...> - 2005-07-03 12:34:26
|
GLa...@ao... wrote:
> Hello there, i have the c++ book for dummies and the Dev C++ program.
> when you first start out in the book it tells that the starter code
> should look like this:
>
>
> #include <iostream>
> #include <stdlib.h>
>
> int main(int argc, char *argv[])
> {
>
> system(*PAUSE*);
> return 0;
> }
>
>
> instead mine reads this
>
>
> #include <cstdlib>
> #include <iostream>
>
> using namespace std;
>
> int main(int argc, char *argv[])
> {
> system("PAUSE");
> return EXIT_SUCCESS;
> }
>
>
> and i followed everything right. i am using an hp with win xp. my
> email address is gla...@ao... <mailto:gla...@ao...>
The code is similar, don't worry. Everything will still function, except
the Dev-C++ code is more recent than the book. Now, instead of
<iostream.h>, we have <iostream>, and because <stdlib.h> was in the C
language, it becomes <cstdlib>. You will learn more on that later. With
the new header files, you must include using namespace std; in your
code, and this will also be explained later. EXIT_SUCCESS is 0, so they
both mean the same thing. Its nothing to worry about, just keep going
and use the dev-c++ base code instead of the books, and if it bothers
you or confuses you, try to find a more recent book.
--
~~Scott Simontis~~
ssi...@sp...
|
|
From: Per W. <pw...@ia...> - 2005-07-03 08:59:15
|
I can only guess but...
I would think that you should do something similar to a hex-dump but
instead of emitting the individual bytes as hexadecimal (00..FF) you
should emit them as decimal (0..255).
pos = 0;
for each byte in file {
if ((pos % 10) == 0) { // 10 bytes/line
if (pos) printf("\n");
printf("%08d",pos); // Emit decimal offset in file.
}
printf(" %3d",byte);
pos++;
}
if (pos) printf("\n");
Remember to open the file in binary mode, i.e.
f = fopen("name","rb");
if using C code.
/Per W
On Sun, 3 Jul 2005, Scott wrote:
> Does anyone, or can anyone help me write a simple console app,
> to scan a file and dump or display it's contents as "Decimal 1 byte binary"
> even just some info, on what i would do to view a file as decimal 1byte...
> would help,
>
> i.e
>
> I want to display or dump to a text file something like...
> the following:
> ----------------------------------------------------------------
> 00000020 105 100 0 0 76 65
> 00000040 84 83 0 0 0 0
> 00000060 0 6 86 77 65
> ----------------------------------------------------------------
> Anyone have any links, or where i should be looking for more info,
> i have done google searches without much luck.
>
> Thanks,
>
> Cheers,
> Scott.
>
>
>
|
|
From: Scott <fre...@ve...> - 2005-07-03 08:03:12
|
Does anyone, or can anyone help me write a simple console app, to scan a file and dump or display it's contents as "Decimal 1 byte = binary" even just some info, on what i would do to view a file as decimal = 1byte... would help,=20 i.e I want to display or dump to a text file something like... the following: ---------------------------------------------------------------- 00000020 105 100 0 0 76 65 00000040 84 83 0 0 0 0 00000060 0 6 86 77 65 ---------------------------------------------------------------- Anyone have any links, or where i should be looking for more info, i have done google searches without much luck. Thanks, Cheers, Scott. |
|
From: <GLa...@ao...> - 2005-07-03 03:39:53
|
Hello there, i have the c++ book for dummies and the Dev C++ program.
when you first start out in the book it tells that the starter code should
look like this:
#include <iostream>
#include <stdlib.h>
int main(int argc, char *argv[])
{
system(*PAUSE*);
return 0;
}
instead mine reads this
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
system("PAUSE");
return EXIT_SUCCESS;
}
and i followed everything right. i am using an hp with win xp. my email
address is _glang69303@aol.com_ (mailto:gla...@ao...)
|
|
From: Josh M. <da...@gm...> - 2005-07-03 02:18:32
|
On 7/2/05, Big Playah <big...@gm...> wrote: > Hi, >=20 > I have some problems while writing my own fileselect dialogue (for > textmode, so windows fileselect dialogue is not good for me) > I haven't found any useful functions to decide if a string points to a > valid (existing) directory or not > I've found stat() but it raised segfault problems (even with valid > directory names, inside stat () function) > are there any other functions to examine my string before calling opendir= () ? >=20 > tia, >=20 > tom >=20 > -- > Coupe Quattro '89 > Typ81 custom '84 >=20 Why not just call opendir() and check for a null pointer after calling it? --=20 Josh "Peace cannot be kept by force. It can only be achieved by understanding." -Albert Einstein |
|
From: Big P. <big...@gm...> - 2005-07-02 23:55:49
|
Hi, I have some problems while writing my own fileselect dialogue (for textmode, so windows fileselect dialogue is not good for me) I haven't found any useful functions to decide if a string points to a valid (existing) directory or not I've found stat() but it raised segfault problems (even with valid directory names, inside stat () function) are there any other functions to examine my string before calling opendir (= ) ? tia, tom --=20 Coupe Quattro '89 Typ81 custom '84 |
|
From: Robert A. <ral...@gm...> - 2005-07-02 13:40:28
|
Consider it an opportunity to refactor the code. Chances are that at
some time while you were writing the code originally you thought of a
way to make it better/simpler or faster, and if you're looking for the
source you probably want to change it anyway, so re-write.
I know it sounds harsh, but I have been there all too often..and there
are disassemblers that will get you back to assembly code and even
some decompilers but what you get back will NEVER be your code. Any
comments you included will be completely lost and your loops will
quite possibly be of a diffferent form than you wrote and any nice
numbers #defines would be now expanded though out your code and any
numerical computations which could have been done at compile time was
already done and won't be undone so if you had:
#define MIN_PER_YEAR =3D 365 * 24 + 60
...
...
/* iteratorate though the year in seconds */
for ( i =3D 0 ; i < MIN_PER_YEAR * 60 ; i++ )
do_x_with_y(i);
You could possibly end up with=20
i =3D 31536000 ;
while ( i )=20
do_x_with_y(i--);
Or possibly much less readable... did I mention that while you should
be able to get global and static variables names back due to the
linking creating references to them...any and all local variable names
WILL be lost as they are all translated into internal address offsets.
So, save yourself the heart ache and re-write, unless you wanted to
learn assembly.
-Robert
On 6/28/05, Tim Whitehouse <TJW...@bl...> wrote:
> I was "experimenting" with options with my g++ compiler when I accidenta=
lly
> have lost my .cc file. I have the .o file. Is there any way to turn the
> object code back into the source code?
|
|
From: Robert A. <ral...@gm...> - 2005-07-02 13:21:04
|
Hello,
I will hazzard a guess that you are getting the address of the
function rather than the value, but I did notice two things that you
may want to review. The first is that you don't beed the friend
declarations since you are using a public method. If you want to
grant special permission to the function then you can access the
'protected' "amount" directly but if you don't need special permission
(which you don't when you use the getter function) you can drop the
friend.
The big question is that is 'jme' in "jme::Money" are you working
inside a separate class or namespace? The Money class in main doesn't
seem to be referenced as such so it's not clear why it's there. It's
possible that if you have been making many changes and that's a hold
over than you are really referencing a different item?
Hope this helps,
Robert
On 6/30/05, jal...@go... <jal...@go...> wrote:
> In my class, when I use the "getter" to display the value I get the right
> output, but when I try using the overloaded extractor operator (<<) I get
> some hex value displayed. Here is some of the code:
> --- snip
> Main.cpp
> int main() {
> Money money("12.21");
>=20
> std::cout << "Value is: " << money.getAmount() << std::endl; // 12.21
> std::cout << "Value is: " << money << std::endl; // hex value????
> return 0;
> }
>=20
>=20
>=20
> The class goes like this:
> ---snip
> Money.hpp
> class Money {
> protected:
> float amount; //!< This variable holds the numerical value
> public:
> //! Constor
> Money(const std::string&);
>=20
> //!Copy constructor
> Money( const Money& );
>=20
> //!Destructor
> ~Money() { std::cout << amount << std::endl;} //<<=3D=3D=3D 12.21
>=20
> // Setters
> ...
> // Getters
> const float getAmount() const;
>=20
> // Overloaded operators
> .....
> friend std::ostream& operator<<( std::ostream&, const jme::Money& );
> friend std::istream& operator>>( std::istream&, jme::Money& );
> ....
> } ; //Money
>=20
>=20
>=20
> and the code looks like this
> --- snip
> jme::Money::Money( const std::string& x){
> this->setAmount(x); // this metho converts the std::string to a float
> }
> const float jme::Money::getAmount() const {
> return this->amount;
> }
> std::ostream&
> jme::operator<<( std::ostream& os, const jme::Money& obj ) {
> os << obj.getAmount(); //<<=3D=3D=3D=3D 0x4b1120
> return os;
> }
> ----- end of snip
> As you can see when using the member method getAmount() the value
> displayed is in the right format, however the extractor operator is not
> doing the job I thought it would.
>=20
> Can anybody tell me what I am doing wrong?
>=20
> TIA
>=20
>=20
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick
> _______________________________________________
> 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: Daniel K. O. <dan...@ya...> - 2005-07-02 03:17:23
|
sab...@ve... wrote:
>though I haven't seen any solution. Any help is greatly appreciated. BTW feel
>free to make comments on the code design too!
>
>
The end() element doesn't exist in a contaier, it's the
"one-after-the-last" element.
If you want to remove the last element with "->ID == ID", I would do it
like this:
---
class compare_id {
unsigned mID;
public:
compare_id(unsigned i) : mID(i) {}
bool operator()(const Entity* a)
{ return a->ID == mID; }
};
void EntityList::removeID(unsigned ID)
{
vector<Entity*>::reverse_iterator ritr;
ritr = find_if(myEntityList.rbegin(), myEntityList.rend(),
compare_id(ID));
if (ritr != myEntityList.rend()) {
vector<Entity*>::iterator itr = ritr.base();
--itr;
delete *itr;
myEntityList.erase(itr);
}
}
---
If your primary access to the elements are through the IDs, you could
try another container like map<> or multimap<>.
---
Daniel K. O.
_______________________________________________________
Yahoo! Acesso Grátis - Internet rápida e grátis.
Instale o discador agora! http://br.acesso.yahoo.com/
|
|
From: <sab...@ve...> - 2005-07-02 01:33:45
|
Hello there,
I am having a few problems with the following code. It compiles fine but when
it is run, it gives a segmentation fault. I narrowed the error to where it
calls erase() on a vector. I've read that other people have this problem too
though I haven't seen any solution. Any help is greatly appreciated. BTW feel
free to make comments on the code design too!
Thanks
void EntityList::removeID(uint ID)
{
uint i = mEntityList.size() - 1;
std::vector<Entity*>::iterator itr;
for (itr = mEntityList.end(); itr > mEntityList.begin(); itr--)
{
if (mEntityList[i]->getID() == ID)
{
delete mEntityList[i];
mEntityList.erase(itr); //< Here's the problem.???
mCount--;
break;
}
else
{
i--;
}
}
}
|
|
From: Malcolm N. <m.n...@wa...> - 2005-07-01 14:58:54
|
Hello Dev-cpp-users,
I want to implement the creation of Precompiled Headers within a
project template and have had no success in this.
Does anyone have any ideas as to how to implement it on a per project
or per template basis?
I can create precompiled headers for a project, adding the files
necessary to the source folder and altering the created project to use
the new files, but would like to have the .gch file located within the
dev-cpp\include directory so that it is available for all projects
(since most projects will be using a standard set of include files)
but I just cannot figure out how to write the makefile to achieve
this. I want to add a makefile.mak file to the project (a project
option, which is not supported when used within the project creation
wizard), and this file should enable building precompiled headers
within the dev-cpp\Include directory.
Currently the contents of this file are :
precomp.h.gch: precomp.h
$(CPP) -c precomp.h -o precomp.h.gch $(CXXFLAGS)
all-before: precomp.h.gch
Basically I would like to know if it is possible to alter the contents
of the makefile to reflect the location of the gch file?
--
Best regards,
Malcolm mailto:m.n...@wa...
|
|
From: Scott S. <ssi...@sp...> - 2005-07-01 14:13:37
|
Salvatore Lionetti wrote:
>Hi,
>many thanks for your response but i not found this
>file somewhere in my pc.
>
>My really need is to have a variable, in template
>makefile, related to current compiler setting, a kind
>of ARCH={CYGWIN,DEVCPP,...}
>
>Hopefully, i'd like to insert some code to template
>makefile, that use such variable to do some work, for
>example add "libwsock32.a" to makefile var LIBS when
>ARCH is DEVCPP, !add it when use ARCH=CYGWIN.
>
>Thank you, have a good day.
>--- Scott Simontis <ssi...@sp...> ha scritto:
>
>
>
>>Salvatore Lionetti wrote:
>>
>>
>>
>>>Hi,
>>>my name's Salvatore and i write you from Italy.
>>>please:
>>>where are stored information about
>>>Tools->CompilersOptions->Compilers?
>>>
>>>Thank you for your attention,
>>>have a good day
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>___________________________________
>>>Yahoo! Mail: gratis 1GB per i messaggi e allegati
>>>
>>>
>>da 10MB
>>
>>
>>>http://mail.yahoo.it
>>>
>>>
>>>
>>>
>>-------------------------------------------------------
>>
>>
>>>SF.Net email is sponsored by: Discover Easy Linux
>>>
>>>
>>Migration Strategies
>>>from IBM. Find simple to follow Roadmaps,
>>straightforward articles,
>>
>>
>>>informative Webcasts and more! Get everything you
>>>
>>>
>>need to get up to
>>
>>
>>>speed, fast.
>>>
>>>
>http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
>
>
>>>_______________________________________________
>>>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
>>
>>
>>>
>>>
>>>
>>>
>>On Windows XP, C:\Documents and Settings\Your User
>>Name\Application
>>Data\Dev-Cpp\devcpp.cfg.
>>
>>--
>>~~Scott Simontis~~
>>ssi...@sp...
>>
>>
>>
>>
>
>
>
>
>
>
>
>___________________________________
>Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
>http://mail.yahoo.it
>
>
>
That file isn't in the configuration file, what your looking for is the
makefile code. I am not too familiar with makefiles, so someone else
might have to help you here. You should be able to add it somewhere. I
don't think you'll be able to set ARCH to devcpp, since devcpp is not a
compiler, but a development environment. You would have to set it to
mingw. I see where you are going though.
--
~~Scott Simontis~~
ssi...@sp...
|
|
From: 365 <to...@ez...> - 2005-07-01 00:41:14
|
365购物网 365shopw专业性化妆品网站 在这里(365shopw.com) 您可以找到世界顶级名牌化妆品: 资生堂、兰蔻、SK-II、倩碧、雅顿、西黛、CD、雅诗兰黛、雅芳等。 传递友情,制造幸福. 活动期间购买任何产品都会得到精美的赠品。 机会就在你掌中,再不行动就迟罗!!! 免费赠送一套840多篇经典网文,各种美容常识、 网站消费各种信息.还有群发软件、搜索软件 免费加盟、免费开店、免费送货,免费咨询旅游信息,航空物流等多项服务。 如果这封善意邮件打扰了您,请随手删掉。我们向您表示道歉! 永远为客户的利益着想。 客服电话:010-85574172 网址:http://www.365shopw.com |
|
From: Michal M. <mi...@mo...> - 2005-06-30 17:08:05
|
Fábio Emilio Costa wrote: > I don't know if anyone has perceived it, but libintl DevPak come without > xgettext utility, so we cannot extract and merge hte string files for > internacionalization. Why? Where could I obtain xgettext? e.g. http://prdownloads.sourceforge.net/gnuwin32/gettext-0.14.4-bin.zip and install it using PackMan -- Regards, Michal ICQ# 175762750 |
|
From: Per W. <pw...@ia...> - 2005-06-30 16:54:48
|
std::xx is for symbols declared inside of the std namespace. Your own
operator is definitely not defined in the std namespace - and you should
never try to define anyting in that namespace. It is only used for
standardized variables, types, methods etc.
You only add the xx:: prefix to a symbol when referencing symbols outside
of the current namespace or any namespace you have specifically said you
are using.
If you don't use any namespaces yourself, just write:
friend std::ostream& operator<<(std::ostream&,const jme::Money&);
std::ostream& operator<<(std::ostream& os,const jme::Money& obj) {
...
}
If the operator was defined within the jme namespace, then you have to
also do the friend declaration specifying:
friend std::ostream& jme::operator<<(std::ostream&,const jme::Money&);
and somewhere else specify the implementation within the jme namespace:
:
namespace jme {
std::ostream& operator<<(std::ostream& os,const Money&) {
...
}
}
/Per W
On Thu, 30 Jun 2005 jal...@go... wrote:
> Yes, I just notice that, so this are the changes I have made:
>
> --- Money.hpp
> friend std::ostream& std::operator<<( std::ostream&, const jme::Money& );
> friend std::istream& std::operator>>( std::istream&, jme::Money& );
>
>
> --- Money.cpp
> std::operator<<( std::ostream& os, const jme::Money& obj ) {
> os << obj.getAmount();
> return os;
> }
> std::istream&
> std::operator>>( std::istream& is, jme::Money& obj ) {
> is >> obj.amount;
> return is;
> }
> --------------
> But this is giving me linker errors sayng:
>
>
> ========= ERROR ===========
> In file included from money.cpp:2:
> money.hpp:67: error: `std::ostream& std::operator<<(std::ostream&, const
> jme::Money&)' should have been declared inside `std'
> money.hpp:68: error: `std::istream& std::operator>>(std::istream&,
> jme::Money&)' should have been declared inside `std'
>
>
> What am I doing wrong!!?
>
> Again thanks for you help.
>
>
>
>
> > What namespaces are you using.
> >
> > You have declared the friend operator as:
> > std::ostream& operator<<(...)
> > and implemented it as:
> > std::ostream& jme::operator<<(...)
> >
> > Without a maching output operator, the compiler will emit the pointer to
> > the object instead.
> >
> > /Per W
> >
> > On Thu, 30 Jun 2005 jal...@go... wrote:
> >
> >> In my class, when I use the "getter" to display the value I get the
> >> right
> >> output, but when I try using the overloaded extractor operator (<<) I
> >> get
> >> some hex value displayed. Here is some of the code:
> >> --- snip
> >> Main.cpp
> >> int main() {
> >> Money money("12.21");
> >>
> >> std::cout << "Value is: " << money.getAmount() << std::endl; // 12.21
> >> std::cout << "Value is: " << money << std::endl; // hex value????
> >> return 0;
> >> }
> >>
> >>
> >>
> >> The class goes like this:
> >> ---snip
> >> Money.hpp
> >> class Money {
> >> protected:
> >> float amount; //!< This variable holds the numerical value
> >> public:
> >> //! Constor
> >> Money(const std::string&);
> >>
> >> //!Copy constructor
> >> Money( const Money& );
> >>
> >> //!Destructor
> >> ~Money() { std::cout << amount << std::endl;} //<<=== 12.21
> >>
> >> // Setters
> >> ...
> >> // Getters
> >> const float getAmount() const;
> >>
> >> // Overloaded operators
> >> .....
> >> friend std::ostream& operator<<( std::ostream&, const jme::Money& );
> >> friend std::istream& operator>>( std::istream&, jme::Money& );
> >> ....
> >> } ; //Money
> >>
> >>
> >>
> >> and the code looks like this
> >> --- snip
> >> jme::Money::Money( const std::string& x){
> >> this->setAmount(x); // this metho converts the std::string to a
> >> float
> >> }
> >> const float jme::Money::getAmount() const {
> >> return this->amount;
> >> }
> >> std::ostream&
> >> jme::operator<<( std::ostream& os, const jme::Money& obj ) {
> >> os << obj.getAmount(); //<<==== 0x4b1120
> >> return os;
> >> }
> >> ----- end of snip
> >> As you can see when using the member method getAmount() the value
> >> displayed is in the right format, however the extractor operator is not
> >> doing
|
|
From: Franziska E. <fra...@ya...> - 2005-06-30 16:09:32
|
hi...
you should remove the std:: before operator:
--- Money.hpp
friend ostream& std::operator<<( std::ostream&, const jme::Money& );
friend istream& std::operator>>( std::istream&, jme::Money& );
--- Money.cpp
operator<<( std::ostream& os, const jme::Money& obj ) {
os << obj.getAmount();
return os;
}
std::istream&
operator>>( std::istream& is, jme::Money& obj ) {
is >> obj.amount;
return is;
}
>Yes, I just notice that, so this are the changes I have made:
>
>--- Money.hpp
>friend std::ostream& std::operator<<( std::ostream&, const jme::Money& );
>friend std::istream& std::operator>>( std::istream&, jme::Money& );
>
>
>--- Money.cpp
>std::operator<<( std::ostream& os, const jme::Money& obj ) {
> os << obj.getAmount();
> return os;
>}
>std::istream&
>std::operator>>( std::istream& is, jme::Money& obj ) {
> is >> obj.amount;
> return is;
>}
>--------------
>But this is giving me linker errors sayng:
>
>
>========= ERROR ===========
>In file included from money.cpp:2:
>money.hpp:67: error: `std::ostream& std::operator<<(std::ostream&, const
>jme::Money&)' should have been declared inside `std'
>money.hpp:68: error: `std::istream& std::operator>>(std::istream&,
>jme::Money&)' should have been declared inside `std'
>
>
>What am I doing wrong!!?
>
>Again thanks for you help.
>
>
>
>
>
>
>>What namespaces are you using.
>>
>>You have declared the friend operator as:
>> std::ostream& operator<<(...)
>>and implemented it as:
>> std::ostream& jme::operator<<(...)
>>
>>Without a maching output operator, the compiler will emit the pointer to
>>the object instead.
>>
>>/Per W
>>
>>On Thu, 30 Jun 2005 jal...@go... wrote:
>>
>>
>>
>>>In my class, when I use the "getter" to display the value I get the
>>>right
>>>output, but when I try using the overloaded extractor operator (<<) I
>>>get
>>>some hex value displayed. Here is some of the code:
>>>--- snip
>>>Main.cpp
>>>int main() {
>>> Money money("12.21");
>>>
>>> std::cout << "Value is: " << money.getAmount() << std::endl; // 12.21
>>> std::cout << "Value is: " << money << std::endl; // hex value????
>>> return 0;
>>>}
>>>
>>>
>>>
>>>The class goes like this:
>>>---snip
>>>Money.hpp
>>>class Money {
>>> protected:
>>> float amount; //!< This variable holds the numerical value
>>> public:
>>> //! Constor
>>> Money(const std::string&);
>>>
>>> //!Copy constructor
>>> Money( const Money& );
>>>
>>> //!Destructor
>>> ~Money() { std::cout << amount << std::endl;} //<<=== 12.21
>>>
>>> // Setters
>>> ...
>>> // Getters
>>> const float getAmount() const;
>>>
>>> // Overloaded operators
>>> .....
>>> friend std::ostream& operator<<( std::ostream&, const jme::Money& );
>>> friend std::istream& operator>>( std::istream&, jme::Money& );
>>> ....
>>>} ; //Money
>>>
>>>
>>>
>>>and the code looks like this
>>>--- snip
>>>jme::Money::Money( const std::string& x){
>>> this->setAmount(x); // this metho converts the std::string to a
>>>float
>>>}
>>>const float jme::Money::getAmount() const {
>>> return this->amount;
>>>}
>>>std::ostream&
>>>jme::operator<<( std::ostream& os, const jme::Money& obj ) {
>>> os << obj.getAmount(); //<<==== 0x4b1120
>>> return os;
>>>}
>>>----- end of snip
>>>As you can see when using the member method getAmount() the value
>>>displayed is in the right format, however the extractor operator is not
>>>doing
>>>
>>>
>>
>>-------------------------------------------------------
>>SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
>>from IBM. Find simple to follow Roadmaps, straightforward articles,
>>informative Webcasts and more! Get everything you need to get up to
>>speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
>>_______________________________________________
>>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.Net email is sponsored by: Discover Easy Linux Migration Strategies
>from IBM. Find simple to follow Roadmaps, straightforward articles,
>informative Webcasts and more! Get everything you need to get up to
>speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
>_______________________________________________
>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
>
>
>
>
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
|