dev-cpp-users Mailing List for Dev-C++ (Page 671)
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: Ioannis V. <no...@ya...> - 2001-09-04 16:39:10
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Michael Codadeen > Sent: Tuesday, September 04, 2001 12:00 PM > To: dev...@li... > Subject: RE: [Dev-C++] how to use strings > > > Hi Johannes, > > I believe that fprintf() does move the file pointer it just > looks as though > it isn't, try using ftell() to print the file position. > > I believe that because there is a struct being written to the > file via > fread() and then a string via fprintf() this is causing the fread() *reads*. fwrite() writes. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys |
|
From: Ioannis V. <no...@ya...> - 2001-09-04 16:36:10
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of Michael Codadeen
> Sent: Tuesday, September 04, 2001 9:49 AM
> To: dev...@li...
> Subject: RE: [Dev-C++] how to use strings
>=20
>=20
> Hi,
>=20
> Did you get the fprintf to work because I am still having trouble.
>=20
> I have also tried it at work on a HPUX 10.20 aCC compiler but neither=20
> version works for reading from a file.
>=20
> fprintf (stdout, "%s", fhandle);
> fprintf (stdout, "%s", *fhandle);
>=20
> Note, the second version works on the Dev C++ compiler but=20
> reads the first=20
> line only.
fprintf() does NOT read from a file, it *writes* to the file.
An example:
FILE *fp=3Dfopen("/usr/tony/test.txt", w");
...
fprintf(fp, "This is written to the file.");
fprintf(fp, "A number %d\n\n", 7);
/* Do what you have to do */
fclose(fp);
If you want the data to be written immediately to the file after one
fprintf(), you can flush the cache buffer:
fflush(fp); /* It flushes the file buffer. All data are written to the
disk */
>=20
> And yes, I agree there are many ways to move the file pointer=20
> and that=20
> seeking to the end of a string is bad strategy. I was just=20
> trying to get the=20
> thing to read from a file using fprintf().
I know, hat's why it did not work, since fprintf() is for *writing* to
a stream. For example you can write to the monitor:
fprintf(stdout, "Hello new stream world!\n");
>=20
> Michael
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
|
|
From: Michael C. <jd...@ho...> - 2001-09-04 14:05:30
|
I read your first mail and have to agree that there may well be undefined
results when you mix and match like we have done.
As for your answer to the second problem, see below for more comments...
>From: Johannes Pretorius <joh...@pr...>
>To: dev...@li...
>Subject: RE: [Dev-C++] how to use strings
>Date: Tue, 04 Sep 2001 14:51:17 +0200
>
>Okay
>Problem 2 is actually kinda simple in the sense if I understand you
>correctly
>
>//SNIP
>
>#include <stdio.h>
>#include <alloc.h>
>
>main(int argc, char *argv[]) {
> FILE *CheckFile;
> int Byte;
> unsigned int Checksum;
> int read=-1;
> int filePos =0;
>
> if ( argc != 2 ) {
> printf("usage: checksum filename\n");
> exit(1);
> }
>
> if ( (CheckFile = fopen(argv[1], "rb")) == NULL ) {
> printf("Can't open file: %s\n", argv[1]);
> exit(1);
> }
>
> /* Initialize the checksum accumulator */
> Checksum = 0;
>
> fseek (CheckFile, 0L, SEEK_SET);
>
> char c1[100];
> char c2[100];
> char c3[100];
> char c4[100];
> char c5[100];
>
> memset(c1,0,100);
> memset(c2,0,100);
> memset(c3,0,100);
> memset(c4,0,100);
> memset(c5,0,100);
> printf ("pos %d\n", ftell (CheckFile));
> printf("Succesfull assignments : %d c1 : %s\n c2 : %s\n",fscanf
>(CheckFile, "%s%s%*[\n]", c1, c2),c1,c2);
>
> //part 1
> printf("Succesfull assignments : %d c3 : %s\n c4 : %s\n c5 : %s
>",fscanf (CheckFile, "%*[^'O]%s%s%s", c3, c4, c5),c3,c4,c5);
*** There is a single quote missing in this, as in my original mail it ***
should read 'O', the character constant for the letter O.
***The following also works but misses the \n.
***fscanf (fhandle, "%s%s%*[^'O']%s%s%s", c1, c2, c3, c4, c5);
> //part 2
> //printf("Succesfull assignments : %d c3 : %s\n c4 : %s\n c5 : %s
>",fscanf (CheckFile, "%s%s%s%*[\n]", c3, c4, c5),c3,c4,c5);
> printf ("pos %d\n", ftell (CheckFile));
> fclose(CheckFile);
> exit(0);
>}
>
>//END SNIP
>
>If you take the above code and run it it does the same as your application.
>If you comment part 1 out and uncomment part 2 it reads the next line as
>needed. The reason is that you have told the function to move the
>cursor until it reaches one of the specified characeters in part 1 that is
>a qute (') or a captial O. This is why it runs until past that point as one
>of there charcters only
>comes after that to test. Enter a capital O in the second line of the
>program.
***As described above, my original example had 'O' in it.
>
>Well this is all I can think of now. One thing thou using %s to read a
>string into a char array is DANGEROUS for the function will read the string
>into it regardless of its size.
>To test put in a string in the first line that is MORE than 100 then printf
>(well I geuss my program can also be wrong)
>
>if you rather use a char pointer you can read in more that the 100
>specified. yust remmeber the free.. here is a code sample to replace in the
>above.
***
I agree. I think a buffer large enough should be allocated for the data to
be placed into. However, in your example you missed out the new() for c1.
The result would be a core dump.
The size for the buffer could be obtained by the number of bytes read and
returned by fread(). As you know fscanf() returns the number of succesfully
assigned input items.
>
>//SNIP 2
> char *c1;
> char c2[100];
> char c3[100];
> char c4[100];
> char c5[100];
>
>// memset(c1,0,100);
> memset(c2,0,100);
> memset(c3,0,100);
> memset(c4,0,100);
> memset(c5,0,100);
> printf ("pos %d\n", ftell (CheckFile));
> printf("Succesfull assignments : %d c1 : %s\n c2 : %s\n",fscanf
>(CheckFile, "%s%s", c1, c2),c1,c2);
> free(c1);
>//END SNIP 2
>
>Well good luck
>Johannes
>
>
I think we have done this subject to death now.
Thanks for all your input.
Michael
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
|
|
From: Johannes P. <joh...@pr...> - 2001-09-04 12:50:12
|
Okay
Problem 2 is actually kinda simple in the sense if I understand you correctly
//SNIP
#include <stdio.h>
#include <alloc.h>
main(int argc, char *argv[]) {
FILE *CheckFile;
int Byte;
unsigned int Checksum;
int read=-1;
int filePos =0;
if ( argc != 2 ) {
printf("usage: checksum filename\n");
exit(1);
}
if ( (CheckFile = fopen(argv[1], "rb")) == NULL ) {
printf("Can't open file: %s\n", argv[1]);
exit(1);
}
/* Initialize the checksum accumulator */
Checksum = 0;
fseek (CheckFile, 0L, SEEK_SET);
char c1[100];
char c2[100];
char c3[100];
char c4[100];
char c5[100];
memset(c1,0,100);
memset(c2,0,100);
memset(c3,0,100);
memset(c4,0,100);
memset(c5,0,100);
printf ("pos %d\n", ftell (CheckFile));
printf("Succesfull assignments : %d c1 : %s\n c2 : %s\n",fscanf
(CheckFile, "%s%s%*[\n]", c1, c2),c1,c2);
//part 1
printf("Succesfull assignments : %d c3 : %s\n c4 : %s\n c5 : %s
",fscanf (CheckFile, "%*[^'O]%s%s%s", c3, c4, c5),c3,c4,c5);
//part 2
//printf("Succesfull assignments : %d c3 : %s\n c4 : %s\n c5 : %s
",fscanf (CheckFile, "%s%s%s%*[\n]", c3, c4, c5),c3,c4,c5);
printf ("pos %d\n", ftell (CheckFile));
fclose(CheckFile);
exit(0);
}
//END SNIP
If you take the above code and run it it does the same as your application.
If you comment part 1 out and uncomment part 2 it reads the next line as
needed. The reason is that you have told the function to move the
cursor until it reaches one of the specified characeters in part 1 that is
a qute (') or a captial O. This is why it runs until past that point as one
of there charcters only
comes after that to test. Enter a capital O in the second line of the program.
Well this is all I can think of now. One thing thou using %s to read a
string into a char array is DANGEROUS for the function will read the string
into it regardless of its size.
To test put in a string in the first line that is MORE than 100 then printf
(well I geuss my program can also be wrong)
if you rather use a char pointer you can read in more that the 100
specified. yust remmeber the free.. here is a code sample to replace in the
above.
//SNIP 2
char *c1;
char c2[100];
char c3[100];
char c4[100];
char c5[100];
// memset(c1,0,100);
memset(c2,0,100);
memset(c3,0,100);
memset(c4,0,100);
memset(c5,0,100);
printf ("pos %d\n", ftell (CheckFile));
printf("Succesfull assignments : %d c1 : %s\n c2 : %s\n",fscanf
(CheckFile, "%s%s", c1, c2),c1,c2);
free(c1);
//END SNIP 2
Well good luck
Johannes
|
|
From: Johannes P. <joh...@pr...> - 2001-09-04 12:21:52
|
>Date: Tue, 04 Sep 2001 13:28:15 +0200
>To: "Michael Codadeen" <jd...@ho...>
>From: Johannes Pretorius <joh...@pr...>
>Subject: RE: [Dev-C++] how to use strings
>
>Hi Michael
>----------------
>
>it seems I described the reason I believe fprintf() wont move the file
>pointer wrong. What I remember and please correct me if I
>am wrong is that the following :
>FILE *filepointer;
>is actually a pointer to a STRUCTURE that is named FILE. This meaning it
>is NOT a memory alocation pointer. I did this long ago so
>the change is very big that I am wrong. So to start of this means that
>reading from the filepointer to stream data to the output stream
>if it is with fprintf() or sprintf() the function does not know HOW to get
>the data (the data is internal to the structure) and secondly the function
>was not writen
>to move the stream pointer (as with sockets I cant remember now but I
>belive you have to use a different reader to get the data. The chance is
>that I am
>incorrect and you must use sprintf as I have done this about 2 years ago I
>kinda forgot with all this Delphi.). But anyways try this application.
>
>//SNIP
>
>#include <stdio.h>
>
>main(int argc, char *argv[]) {
> FILE *CheckFile;
> int Byte;
> unsigned int Checksum;
> int read=-1;
> int filePos =0;
>
> if ( argc != 2 ) {
> printf("usage: checksum filename\n");
> exit(1);
> }
>
> if ( (CheckFile = fopen(argv[1], "r")) == NULL ) {
> printf("Can't open file: %s\n", argv[1]);
> exit(1);
> }
>
> /* Initialize the checksum accumulator */
> Checksum = 0;
>
> /* Add each byte in turn into the checksum accumulator */
> while ((!feof(CheckFile)) && (!ferror(CheckFile))) {
> filePos = ftell(CheckFile);
> printf("filePos : %d\n",filePos);
> read = fprintf(stdout,"%s",*CheckFile);
> if (read){
> printf("read : %d\n",read);
> if ((!feof(CheckFile)) && (!ferror(CheckFile))) {
> printf("set file pos\n");
> if (fseek(CheckFile,read,SEEK_CUR) != 0){
> printf("Error setting file Pos\n");
> break;
> }
> }else{
> break;
> }
> } else{
> printf("Error reading ");
> break;
> }
> }
> fclose(CheckFile);
> exit(0);
>}
>
>
>//END SNIP
>
>You will see that we read and read and nothing gets done. This is a result
>that I dont understand actually as it is suppose to read until EOF.
>
>I hope something makes some more sense.
>
>I am looking at the second problem will be back an about 10 minutes
>Johanens
>
>
>
>
>
>
>At 10:00 04/09/2001 +0000, you wrote:
>>Hi Johannes,
>>
>>I believe that fprintf() does move the file pointer it just looks as
>>though it isn't, try using ftell() to print the file position.
>>
>>I believe that because there is a struct being written to the file via
>>fread() and then a string via fprintf() this is causing the problem as
>>you suggested.
>>
>>These functions generally should never be mixed as the problems we are
>>seeing are caused. Also when reading files between different systems
>>there are problems concerning the endianess (big endian/little endian)
>>for the file, allignment, etc. For example, the allignment of an int on
>>one machine may be different for another. One would have to define a
>>common alligned struct for writing, similar to the way X11, sockets, and
>>other network protocols do it.
>>
>>However, we are only using one os in this case so this shouldn't be a
>>problem.
>>
>>I also used fgets() and feof() to test for EOF. The output is only "Hallo
>>World", and it doesn't see the number on the next line but reports EOF.
>>
>> char line [256];
>> while (fgets (line, 256, fhandle) != NULL)
>> {
>> printf ("%s", line);
>> }
>>
>> if (feof (fhandle))
>> {
>> printf ("EOF for fhandle.\n");
>> }
>>
>>However, I have also used fscanf()with the field specifier and the
>>circumflex symbol to ignore upto the newline, etc. This works in certain
>>circumstances, i.e. only when I specify two scanf() commands as opposed to one.
>>
>> fseek (fhandle, 0L, SEEK_SET);
>>
>> char c1[100];
>> char c2[100];
>> char c3[100];
>> char c4[100];
>> char c5[100];
>>
>>/*
>> // doesn't work - only sees first line
>>
>> printf ("pos %d\n", ftell (fhandle));
>> fscanf (fhandle, "%s%s%*[^\n]%*[^'O']%s%s%s", c1, c2, c3, c4, c5);
>> printf ("%s %s %s %s %s\n", c1, c2, c3, c4, c5);
>> printf ("pos %d\n", ftell (fhandle));
>>*/
>>
>> // works well
>>
>> printf ("pos %d\n", ftell (fhandle));
>> fscanf (fhandle, "%s%s%*[^\n]", c1, c2);
>> printf ("%s %s\n", c1, c2);
>>
>> fscanf (fhandle, "%*[^'O']%s%s%s", c3, c4, c5);
>> printf ("pos %d\n", ftell (fhandle));
>> printf ("%s %s %s\n", c3, c4, c5);
>>
>>
>>You will notice that the file position is over 200 at the end of the
>>program. This leads me to conclude that because of the 'crap' after the
>>first string this causes problems for the string functions, we therefore
>>need to ignore this stuff.
>>
>>This doesn't explain why I need two fscanf()s to do this. Although I have
>>been testing on a HPUX compiler and this should work.
>>
>>Regards,
>>
>>Michael
>>
>>
>>
>>_________________________________________________________________
>>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>>
>>
>>_______________________________________________
>>Dev-cpp-users mailing list
>>Dev...@li...
>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>Johannes Pretorius
>(Development Department - Promed)
>
>Tel : +27 11 263-5920
>website : http://www.promed.co.za
|
|
From: Michael C. <jd...@ho...> - 2001-09-04 10:00:15
|
Hi Johannes,
I believe that fprintf() does move the file pointer it just looks as though
it isn't, try using ftell() to print the file position.
I believe that because there is a struct being written to the file via
fread() and then a string via fprintf() this is causing the problem as you
suggested.
These functions generally should never be mixed as the problems we are
seeing are caused. Also when reading files between different systems there
are problems concerning the endianess (big endian/little endian) for the
file, allignment, etc. For example, the allignment of an int on one machine
may be different for another. One would have to define a common alligned
struct for writing, similar to the way X11, sockets, and other network
protocols do it.
However, we are only using one os in this case so this shouldn't be a
problem.
I also used fgets() and feof() to test for EOF. The output is only "Hallo
World", and it doesn't see the number on the next line but reports EOF.
char line [256];
while (fgets (line, 256, fhandle) != NULL)
{
printf ("%s", line);
}
if (feof (fhandle))
{
printf ("EOF for fhandle.\n");
}
However, I have also used fscanf()with the field specifier and the
circumflex symbol to ignore upto the newline, etc. This works in certain
circumstances, i.e. only when I specify two scanf() commands as opposed to
one.
fseek (fhandle, 0L, SEEK_SET);
char c1[100];
char c2[100];
char c3[100];
char c4[100];
char c5[100];
/*
// doesn't work - only sees first line
printf ("pos %d\n", ftell (fhandle));
fscanf (fhandle, "%s%s%*[^\n]%*[^'O']%s%s%s", c1, c2, c3, c4, c5);
printf ("%s %s %s %s %s\n", c1, c2, c3, c4, c5);
printf ("pos %d\n", ftell (fhandle));
*/
// works well
printf ("pos %d\n", ftell (fhandle));
fscanf (fhandle, "%s%s%*[^\n]", c1, c2);
printf ("%s %s\n", c1, c2);
fscanf (fhandle, "%*[^'O']%s%s%s", c3, c4, c5);
printf ("pos %d\n", ftell (fhandle));
printf ("%s %s %s\n", c3, c4, c5);
You will notice that the file position is over 200 at the end of the
program. This leads me to conclude that because of the 'crap' after the
first string this causes problems for the string functions, we therefore
need to ignore this stuff.
This doesn't explain why I need two fscanf()s to do this. Although I have
been testing on a HPUX compiler and this should work.
Regards,
Michael
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
|
|
From: Michael C. <jd...@ho...> - 2001-09-04 07:48:59
|
Hi,
Did you get the fprintf to work because I am still having trouble.
I have also tried it at work on a HPUX 10.20 aCC compiler but neither
version works for reading from a file.
fprintf (stdout, "%s", fhandle);
fprintf (stdout, "%s", *fhandle);
Note, the second version works on the Dev C++ compiler but reads the first
line only.
And yes, I agree there are many ways to move the file pointer and that
seeking to the end of a string is bad strategy. I was just trying to get the
thing to read from a file using fprintf().
Michael
>From: "Ioannis Vranos" <no...@ya...>
>To: "Dev-C++" <dev...@li...>
>Subject: RE: [Dev-C++] how to use strings
>Date: Tue, 4 Sep 2001 02:13:53 +0200
>
> > -----Original Message-----
> > From: dev...@li...
> > [mailto:dev...@li...] On Behalf
> > Of Michael C
> > Sent: Monday, September 03, 2001 10:37 PM
> > To: dev...@li...
> > Subject: Re: [Dev-C++] how to use strings
> > 3) fprintf() and fscanf() do not move the file position and I
> > can't remember how to do this. So another call to fprintf()
>
>Of course they do. There are thousands of many ways to move the file
>position, fseek(), fread(), ....
>
> > will not read the stringified number on the next line. I
> > thought I could use:
> > 'fseek (fhandle, len, SEEK_CUR);' where len is the
> > returned value from a successful call to fprintf()
>
>The strategy is a mistake.
>
> > However, this doesn't work. Instead I prefer to use:
> >
> > int c;
> > while ((c = fgetc (fhandle)) != EOF)
> > {
> > fputc (c, stdout);
> > }
> >
>
>This works too.
>
> > Any comments?
> >
> > Hope this helps.
> >
> > Michael
>
>
>Ioannis
>
>* Ioannis Vranos
>* Programming pages: http://www.noicys.f2s.com
>* Alternative URL: http://run.to/noicys
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
|
|
From: Michael C. <jd...@ho...> - 2001-09-04 07:11:00
|
Hi,
Yes this is how I would have done this in the past, it's just that the
person wanted to use fprintf().
Also, I would have used stat() to obtain the size of the file unless (which
is why you have shown this) the file is too big and you just wanted to read
it in chunks.
Generally, (as you know) we know the size of the structs we read in so we
would probably allocate memory for a number of structs and read that in at
one time - whatever is more efficient for our program to do.
Michael
>From: Johannes Pretorius <joh...@pr...>
>To: "Michael C" <jd...@ho...>
>CC: dev...@li...
>Subject: Re: [Dev-C++] how to use strings
>Date: Tue, 04 Sep 2001 07:38:15 +0200
>
>Okay I dont reaaly know what You want to do. Considering you want to read
>in a structure I will say use fread !!! else try something like
>this if you want a block of data
>
>//SNIP
>
>#include <stdio.h>
>#include <fcntl.h>
>#include <alloc.h> /* alloc.h for Borland compilers,
> malloc.h for Microsoft compilers */
>
>#define BUFFER_SIZE 0x8000 /* 32Kb data buffer */
>
>main(int argc, char *argv[]) {
> int Handle;
> unsigned int Checksum;
> unsigned char *WorkingBuffer;
> int WorkingLength;
>
> if ( argc != 2 ) {
> printf("usage: checksum filename\n");
> exit(1);
> }
>
> if ( (Handle = open(argv[1], O_RDONLY | O_BINARY)) == -1 ) {
> printf("Can't open file: %s\n", argv[1]);
> exit(1);
> }
>
> /* Get memory in which to buffer the data */
> if ( (WorkingBuffer = (unsigned char *)malloc(BUFFER_SIZE)) == NULL ) {
> printf("Can't get enough memory\n");
> exit(1);
> }
>
> /* Initialize the checksum accumulator */
> Checksum = 0;
>
> /* Process the file in 32Kb chunks */
> do {
> if ( (WorkingLength = read(Handle, WorkingBuffer,
> BUFFER_SIZE)) == -1 ) {
> printf("Error reading file %s\n", argv[1]);
> exit(1);
> }
> /* Checksum this chunk if there's anything in it */
> if ( WorkingLength ) {
> //Beneath part is in assembler file. So I commented it out
> //ChecksumChunk(WorkingBuffer, WorkingLength, &Checksum);
> }
> } while ( WorkingLength );
>
> /* Report the result */
> printf("The checksum is: %u\n", Checksum);
>
> exit(0);
>}
>
>//END SNIP
>
>NOTE : The above code will always have a checksum of 0 as it is not calling
>the assembler function that is in a different file.
>else a more simple straight forward approach will be
>
>//SNIP
>/*
> * Program to calculate the 16-bit checksum of the stream of bytes
> * from the specified file. Obtains the bytes one at a time via
> * getc(), allowing C to perform data buffering.
> */
>#include <stdio.h>
>
>main(int argc, char *argv[]) {
> FILE *CheckFile;
> int Byte;
> unsigned int Checksum;
>
> if ( argc != 2 ) {
> printf("usage: checksum filename\n");
> exit(1);
> }
>
> if ( (CheckFile = fopen(argv[1], "rb")) == NULL ) {
> printf("Can't open file: %s\n", argv[1]);
> exit(1);
> }
>
> /* Initialize the checksum accumulator */
> Checksum = 0;
>
> /* Add each byte in turn into the checksum accumulator */
> while ( (Byte = getc(CheckFile)) != EOF ) {
> Checksum += (unsigned int) Byte;
> }
>
> /* Report the result */
> printf("The checksum is: %u\n", Checksum);
>
> exit(0);
>}
>
>//END SNIP
>
>Now this is basic stuff that I can think of right now. Futher more if you
>can give more information on what you want to achieve maybe we can help
>
>
>hope this helps
>Johannes
>
>
>
>At 21:34 03/09/2001 +0100, you wrote:
>>Hi,
>>
>>I havn't programmed in C for a couple of years now, I've been
>>concentrating
>>on C++.
>>I have forgotten a few things so I'm watching this group for input, and
>>I've
>>been impressed by what I have seen.
>>
>>I had a look at your code and spotted a few things:
>>
>>1) For fopen() use "w+" as you need to read it as well.
>>2) Use ' fseek (fhandle, 0L, SEEK_SET);' to reposition the file to the
>>beginning for reading.
>>3) Dereference fhandle (*fhandle) in the fprintf() statement and this will
>>read in the string.
>>3) fprintf() and fscanf() do not move the file position and I can't
>>remember
>>how to do this. So another call to fprintf() will not read the stringified
>>number on the next line. I thought I could use:
>> 'fseek (fhandle, len, SEEK_CUR);' where len is the returned value
>>from a successful call to fprintf()
>> However, this doesn't work. Instead I prefer to use:
>>
>> int c;
>> while ((c = fgetc (fhandle)) != EOF)
>> {
>> fputc (c, stdout);
>> }
>>
>>Any comments?
>>
>>Hope this helps.
>>
>>Michael
>>
>>----- Original Message -----
>>From: Johannes Pretorius <joh...@pr...>
>>To: <jsc...@gm...>
>>Cc: <dev...@li...>
>>Sent: Monday, September 03, 2001 2:07 PM
>>Subject: Re: [Dev-C++] how to use strings
>>
>>
>> > this here is a simple example that will make more sense. For
>>considering
>> > that you are trying to mix
>> > your WINAPI functions and write to the handle of the file allocators. I
>>do
>> > not think that it is possible in
>> > the compiler version. Maybe with a Microsft compiler.
>> >
>> > else this is a VERY simple way to do it that works. I hope this help.,
>> > Please mail if I misunderstand you.
>> >
>> > file://====== SNIP =========
>> >
>> > #include <iostream.h>
>> > #include <stdio.h>
>> > #include <stdlib.h>
>> >
>> >
>> >
>> > struct test{
>> > char data [200];
>> > }testdata;
>> >
>> > void main(void){
>> > char outstring[200];
>> > FILE *fhandle;
>> > int actualnumber;
>> >
>> > file://open in write mode (override if exist);
>> > fhandle = fopen("c:\\medcelldata.txt","w");
>> > /*CreateFile("c:/medcelldata.txt",
>> > GENERIC_READ | GENERIC_WRITE,
>> > 0,
>> > NULL,
>> > OPEN_ALWAYS,
>> > FILE_ATTRIBUTE_NORMAL,
>> > NULL
>> > );
>> > */
>> >
>> > if(fhandle == NULL)
>> > {
>> > printf("\nNO File present");
>> > }
>> >
>> > file://copy test to structuer
>> > strcpy(testdata.data,"Hallo World\n");
>> >
>> > actualnumber = 1000;
>> >
>> > file://write using fwrite (BETTER for Structures)
>> > fwrite(&testdata, sizeof(testdata), 1, fhandle);
>> >
>> > file://convert integer
>> > itoa(actualnumber, outstring, 10);
>> >
>> > file://write with fprintf to file
>> > fprintf(fhandle,"OutString : %s",outstring);
>> >
>> > file://clsoe file
>> > fclose(fhandle);
>> > }
>> >
>> >
>> >
>> >
>> > file://========= END SNIP =========
>> >
>> > Hope it helps
>> > Johannes
>> >
>> >
>> >
>> > At 14:03 03/09/2001 +0200, you wrote:
>> > >On 3 Sep 2001, at 11:57, Johannes Pretorius wrote:
>> > >
>> > > > Johannes Pretorius <joh...@pr...>
>> > >
>> > >
>> > >Here it is ! i allready change something to make it run - but in the
>> > >written file there only occurs 1- or two figures !
>> > >
>> > >How can i use the fprintf - function to access the file ????
>> > >
>> > >
>> > >
>> > >#include <iostream.h>
>> > >#include <stdio.h>
>> > >#include <stdlib.h>
>> > >#include <windows.h>
>> > >
>> > >// vars
>> > >
>> > >HANDLE hcom; // file handler
>> > >HANDLE hfile;
>> > >DWORD dwWritten;
>> > >
>> > >int value[8];
>> > >int numofdata[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} ;
>> > >
>> > >BYTE noise; // for testing only
>> > >BYTE activeitem; // no of active row
>> > >
>> > >BYTE in_buffer[35]; // input buffer = 8
>>needed
>> > >BYTE out_buffer[35]; // output buffer
>> > >
>> > >int writepoint;
>> > >int readpoint;
>> > >int writepointin; // write pos inbuffer
>> > >int readpointin; // read pos inbuffer
>> > >int goodvalue;
>> > >int tempvalue;
>> > >int actualnumber;
>> > >
>> > >BYTE input;
>> > >BYTE count;
>> > >int globalschleife;
>> > >LPTSTR lpMessage;
>> > >
>> > >int progmode; // bin or asc
>> > >
>> > >
>> > >....
>> > >
>> > > hfile = CreateFile("E:/medcelldata.txt",
>> > > GENERIC_READ | GENERIC_WRITE,
>> > > 0,
>> > > NULL,
>> > > OPEN_ALWAYS,
>> > > FILE_ATTRIBUTE_NORMAL,
>> > > NULL
>> > > );
>> > >
>> > > if(hfile == INVALID_HANDLE_VALUE)
>> > > {
>> > > printf("\nNO File present");
>> > > }
>> > >
>> > > pstr = "MedCellCom 1.2\n\n ";
>> > > WriteFile(hfile, pstr, 16, &dwWritten, NULL);
>> > >
>> > >
>> > > pstr = "Prozess - Protokoll vom : \n ";
>> > >
>> > > WriteFile(hfile, pstr, 27, &dwWritten, NULL);
>> > >
>> > >
>> > > itoa(actualnumber, outstring, 10);
>> > >
>> > > WriteFile(hfile, outstring, 10, &dwWritten,
>>NULL);
>> > >
>> > > WriteFile(hfile, "456", 3, &dwWritten, NULL);
>> > >
>> > > printf("%d\t", dwWritten);
>> > > printf("%s\n", outstring);
>> > >
>> > >
>> > >
>> > >The output shows only
>> > >
>> > > MedCellCom 1.2
>> > >
>> > > Prozess - Protokoll vom :
>> > >2
>> > >
>> > >Where "2" ist the actualnumber
>> > >
>> > >I do not see the 456 test string allthoug the screen
>> > >shows the correct outstring and 3 chars written !
>> > >
>> > >It is a big loop, where many lines are written and
>> > >shown on the screeen it works and the prog terminates.
>> > >
>> > >When writing only dummy strings like explicit
>> > >"iugnuztf" it works and show 200 lines with exactly
>> > >this text !
>> > >
>> > >????
>> >
>> >
>> > _______________________________________________
>> > Dev-cpp-users mailing list
>> > Dev...@li...
>> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>> >
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
|
|
From: Johannes P. <joh...@pr...> - 2001-09-04 05:37:06
|
Okay I dont reaaly know what You want to do. Considering you want to read
in a structure I will say use fread !!! else try something like
this if you want a block of data
//SNIP
#include <stdio.h>
#include <fcntl.h>
#include <alloc.h> /* alloc.h for Borland compilers,
malloc.h for Microsoft compilers */
#define BUFFER_SIZE 0x8000 /* 32Kb data buffer */
main(int argc, char *argv[]) {
int Handle;
unsigned int Checksum;
unsigned char *WorkingBuffer;
int WorkingLength;
if ( argc != 2 ) {
printf("usage: checksum filename\n");
exit(1);
}
if ( (Handle = open(argv[1], O_RDONLY | O_BINARY)) == -1 ) {
printf("Can't open file: %s\n", argv[1]);
exit(1);
}
/* Get memory in which to buffer the data */
if ( (WorkingBuffer = (unsigned char *)malloc(BUFFER_SIZE)) == NULL ) {
printf("Can't get enough memory\n");
exit(1);
}
/* Initialize the checksum accumulator */
Checksum = 0;
/* Process the file in 32Kb chunks */
do {
if ( (WorkingLength = read(Handle, WorkingBuffer,
BUFFER_SIZE)) == -1 ) {
printf("Error reading file %s\n", argv[1]);
exit(1);
}
/* Checksum this chunk if there's anything in it */
if ( WorkingLength ) {
//Beneath part is in assembler file. So I commented it out
//ChecksumChunk(WorkingBuffer, WorkingLength, &Checksum);
}
} while ( WorkingLength );
/* Report the result */
printf("The checksum is: %u\n", Checksum);
exit(0);
}
//END SNIP
NOTE : The above code will always have a checksum of 0 as it is not calling
the assembler function that is in a different file.
else a more simple straight forward approach will be
//SNIP
/*
* Program to calculate the 16-bit checksum of the stream of bytes
* from the specified file. Obtains the bytes one at a time via
* getc(), allowing C to perform data buffering.
*/
#include <stdio.h>
main(int argc, char *argv[]) {
FILE *CheckFile;
int Byte;
unsigned int Checksum;
if ( argc != 2 ) {
printf("usage: checksum filename\n");
exit(1);
}
if ( (CheckFile = fopen(argv[1], "rb")) == NULL ) {
printf("Can't open file: %s\n", argv[1]);
exit(1);
}
/* Initialize the checksum accumulator */
Checksum = 0;
/* Add each byte in turn into the checksum accumulator */
while ( (Byte = getc(CheckFile)) != EOF ) {
Checksum += (unsigned int) Byte;
}
/* Report the result */
printf("The checksum is: %u\n", Checksum);
exit(0);
}
//END SNIP
Now this is basic stuff that I can think of right now. Futher more if you
can give more information on what you want to achieve maybe we can help
hope this helps
Johannes
At 21:34 03/09/2001 +0100, you wrote:
>Hi,
>
>I havn't programmed in C for a couple of years now, I've been concentrating
>on C++.
>I have forgotten a few things so I'm watching this group for input, and I've
>been impressed by what I have seen.
>
>I had a look at your code and spotted a few things:
>
>1) For fopen() use "w+" as you need to read it as well.
>2) Use ' fseek (fhandle, 0L, SEEK_SET);' to reposition the file to the
>beginning for reading.
>3) Dereference fhandle (*fhandle) in the fprintf() statement and this will
>read in the string.
>3) fprintf() and fscanf() do not move the file position and I can't remember
>how to do this. So another call to fprintf() will not read the stringified
>number on the next line. I thought I could use:
> 'fseek (fhandle, len, SEEK_CUR);' where len is the returned value
>from a successful call to fprintf()
> However, this doesn't work. Instead I prefer to use:
>
> int c;
> while ((c = fgetc (fhandle)) != EOF)
> {
> fputc (c, stdout);
> }
>
>Any comments?
>
>Hope this helps.
>
>Michael
>
>----- Original Message -----
>From: Johannes Pretorius <joh...@pr...>
>To: <jsc...@gm...>
>Cc: <dev...@li...>
>Sent: Monday, September 03, 2001 2:07 PM
>Subject: Re: [Dev-C++] how to use strings
>
>
> > this here is a simple example that will make more sense. For considering
> > that you are trying to mix
> > your WINAPI functions and write to the handle of the file allocators. I do
> > not think that it is possible in
> > the compiler version. Maybe with a Microsft compiler.
> >
> > else this is a VERY simple way to do it that works. I hope this help.,
> > Please mail if I misunderstand you.
> >
> > file://====== SNIP =========
> >
> > #include <iostream.h>
> > #include <stdio.h>
> > #include <stdlib.h>
> >
> >
> >
> > struct test{
> > char data [200];
> > }testdata;
> >
> > void main(void){
> > char outstring[200];
> > FILE *fhandle;
> > int actualnumber;
> >
> > file://open in write mode (override if exist);
> > fhandle = fopen("c:\\medcelldata.txt","w");
> > /*CreateFile("c:/medcelldata.txt",
> > GENERIC_READ | GENERIC_WRITE,
> > 0,
> > NULL,
> > OPEN_ALWAYS,
> > FILE_ATTRIBUTE_NORMAL,
> > NULL
> > );
> > */
> >
> > if(fhandle == NULL)
> > {
> > printf("\nNO File present");
> > }
> >
> > file://copy test to structuer
> > strcpy(testdata.data,"Hallo World\n");
> >
> > actualnumber = 1000;
> >
> > file://write using fwrite (BETTER for Structures)
> > fwrite(&testdata, sizeof(testdata), 1, fhandle);
> >
> > file://convert integer
> > itoa(actualnumber, outstring, 10);
> >
> > file://write with fprintf to file
> > fprintf(fhandle,"OutString : %s",outstring);
> >
> > file://clsoe file
> > fclose(fhandle);
> > }
> >
> >
> >
> >
> > file://========= END SNIP =========
> >
> > Hope it helps
> > Johannes
> >
> >
> >
> > At 14:03 03/09/2001 +0200, you wrote:
> > >On 3 Sep 2001, at 11:57, Johannes Pretorius wrote:
> > >
> > > > Johannes Pretorius <joh...@pr...>
> > >
> > >
> > >Here it is ! i allready change something to make it run - but in the
> > >written file there only occurs 1- or two figures !
> > >
> > >How can i use the fprintf - function to access the file ????
> > >
> > >
> > >
> > >#include <iostream.h>
> > >#include <stdio.h>
> > >#include <stdlib.h>
> > >#include <windows.h>
> > >
> > >// vars
> > >
> > >HANDLE hcom; // file handler
> > >HANDLE hfile;
> > >DWORD dwWritten;
> > >
> > >int value[8];
> > >int numofdata[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} ;
> > >
> > >BYTE noise; // for testing only
> > >BYTE activeitem; // no of active row
> > >
> > >BYTE in_buffer[35]; // input buffer = 8
>needed
> > >BYTE out_buffer[35]; // output buffer
> > >
> > >int writepoint;
> > >int readpoint;
> > >int writepointin; // write pos inbuffer
> > >int readpointin; // read pos inbuffer
> > >int goodvalue;
> > >int tempvalue;
> > >int actualnumber;
> > >
> > >BYTE input;
> > >BYTE count;
> > >int globalschleife;
> > >LPTSTR lpMessage;
> > >
> > >int progmode; // bin or asc
> > >
> > >
> > >....
> > >
> > > hfile = CreateFile("E:/medcelldata.txt",
> > > GENERIC_READ | GENERIC_WRITE,
> > > 0,
> > > NULL,
> > > OPEN_ALWAYS,
> > > FILE_ATTRIBUTE_NORMAL,
> > > NULL
> > > );
> > >
> > > if(hfile == INVALID_HANDLE_VALUE)
> > > {
> > > printf("\nNO File present");
> > > }
> > >
> > > pstr = "MedCellCom 1.2\n\n ";
> > > WriteFile(hfile, pstr, 16, &dwWritten, NULL);
> > >
> > >
> > > pstr = "Prozess - Protokoll vom : \n ";
> > >
> > > WriteFile(hfile, pstr, 27, &dwWritten, NULL);
> > >
> > >
> > > itoa(actualnumber, outstring, 10);
> > >
> > > WriteFile(hfile, outstring, 10, &dwWritten, NULL);
> > >
> > > WriteFile(hfile, "456", 3, &dwWritten, NULL);
> > >
> > > printf("%d\t", dwWritten);
> > > printf("%s\n", outstring);
> > >
> > >
> > >
> > >The output shows only
> > >
> > > MedCellCom 1.2
> > >
> > > Prozess - Protokoll vom :
> > >2
> > >
> > >Where "2" ist the actualnumber
> > >
> > >I do not see the 456 test string allthoug the screen
> > >shows the correct outstring and 3 chars written !
> > >
> > >It is a big loop, where many lines are written and
> > >shown on the screeen it works and the prog terminates.
> > >
> > >When writing only dummy strings like explicit
> > >"iugnuztf" it works and show 200 lines with exactly
> > >this text !
> > >
> > >????
> >
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
|
|
From: Johannes P. <joh...@pr...> - 2001-09-04 05:21:52
|
Lo there
========
I Believe this is something small can you give more specific error message
or screen shot on the error
provided also your OS. As this is not suppose to give a error even if it
is a Windows project.
Futher after that maybe we can help you out :)..
C Ya
Johannes
At 22:52 03/09/2001 +0200, you wrote:
>I've been trying to get assembly to work in Dev-C++, but I'm desperate!
>Here's what I tried: (replace periods at start of line with spaces)
>
>void SetMode13h()
>{
>..asm("movw %ax,0x0013");
>..asm("int $10");
>}
>
>It compiles alright, but when I call this function, I get a Windows error!
>It seems that the first asm line is wrong, and, I'm not sure whether the
>second line will work either! This was the idea I was trying to do (In
>ordinary assembler)
>
>Void SetMode13h()
>{
>..asm
>..{
>....mov ax, 0x0013h
>....int 10h
>..}
>}
>
>
>Can anybody explain what's wrong with the code I wrote? And how can I fix it?
>Thanks, Leon Buikstra
>
>(If I sent this mail twice, blame chello!)
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Ioannis V. <no...@ya...> - 2001-09-03 23:18:28
|
I noticed today, that when i press the reply on any message of the mailing list an email to the email address of the person posted is prepared, instead of an email to the list. I think this is a bug that must be fixed. Regards, Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/> * Alternative URL: http://run.to/noicys |
|
From: Ioannis V. <no...@ya...> - 2001-09-03 23:12:54
|
I do not know assembly (yet) but the general syntax is something like
that:
asm("modpc 0, 0, %0" : "=3Dr" (tmp));
Take a look at http://www.research.att.com/~bs/esc99.html too.
For getting windows errors 2 things are possible:
1) You do crazy things. :)
2) Windows work in protected mode, that means you can't access system
components directly. You can't draw graphics accessing the graphics card
directly for example. For this thing windows provide system calls (API)
like the Win32 API, MFC API, e.t.c.. This is the most possible cause of
your problems.
For example some time ago i was taking function pointers, assigned them
in a char * and i printed their contents in the monitor "to see how they
look like". This is possile to DOS but impossible to Windows since
memory is protected.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of Leon Buikstra
> Sent: Monday, September 03, 2001 10:53 PM
> To: dev...@li...
> Subject: [Dev-C++] Simple inline assembly. What am I doing wrong?
>=20
>=20
> I've been trying to get assembly to work in Dev-C++, but I'm=20
> desperate!=20
> Here's what I tried: (replace periods at start of line with spaces)
>=20
> void SetMode13h()
> {
> ..asm("movw %ax,0x0013");
> ..asm("int $10");
> }
>=20
> It compiles alright, but when I call this function, I get a=20
> Windows error!=20
> It seems that the first asm line is wrong, and, I'm not sure=20
> whether the=20
> second line will work either! This was the idea I was trying=20
> to do (In=20
> ordinary assembler)
>=20
> Void SetMode13h()
> {
> ..asm
> ..{
> ....mov ax, 0x0013h
> ....int 10h
> ..}
> }
>=20
>=20
> Can anybody explain what's wrong with the code I wrote? And=20
> how can I fix=20
> it?
> Thanks, Leon Buikstra
>=20
> (If I sent this mail twice, blame chello!)
>=20
> _________________________________________________________________
> Get your FREE download of MSN Explorer at=20
> http://explorer.msn.com/intl.asp
>=20
>=20
>=20
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
|
|
From: Ioannis V. <no...@ya...> - 2001-09-03 23:12:39
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Michael C
> Sent: Monday, September 03, 2001 10:37 PM
> To: dev...@li...
> Subject: Re: [Dev-C++] how to use strings
> 3) fprintf() and fscanf() do not move the file position and I
> can't remember how to do this. So another call to fprintf()
Of course they do. There are thousands of many ways to move the file
position, fseek(), fread(), ....
> will not read the stringified number on the next line. I
> thought I could use:
> 'fseek (fhandle, len, SEEK_CUR);' where len is the
> returned value from a successful call to fprintf()
The strategy is a mistake.
> However, this doesn't work. Instead I prefer to use:
>
> int c;
> while ((c = fgetc (fhandle)) != EOF)
> {
> fputc (c, stdout);
> }
>
This works too.
> Any comments?
>
> Hope this helps.
>
> Michael
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
|
|
From: Leon B. <bo...@ho...> - 2001-09-03 20:52:49
|
I've been trying to get assembly to work in Dev-C++, but I'm desperate!
Here's what I tried: (replace periods at start of line with spaces)
void SetMode13h()
{
..asm("movw %ax,0x0013");
..asm("int $10");
}
It compiles alright, but when I call this function, I get a Windows error!
It seems that the first asm line is wrong, and, I'm not sure whether the
second line will work either! This was the idea I was trying to do (In
ordinary assembler)
Void SetMode13h()
{
..asm
..{
....mov ax, 0x0013h
....int 10h
..}
}
Can anybody explain what's wrong with the code I wrote? And how can I fix
it?
Thanks, Leon Buikstra
(If I sent this mail twice, blame chello!)
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
|
|
From: Michael C <jd...@ho...> - 2001-09-03 20:30:51
|
Hi,
I havn't programmed in C for a couple of years now, I've been concentrating
on C++.
I have forgotten a few things so I'm watching this group for input, and I've
been impressed by what I have seen.
I had a look at your code and spotted a few things:
1) For fopen() use "w+" as you need to read it as well.
2) Use ' fseek (fhandle, 0L, SEEK_SET);' to reposition the file to the
beginning for reading.
3) Dereference fhandle (*fhandle) in the fprintf() statement and this will
read in the string.
3) fprintf() and fscanf() do not move the file position and I can't remember
how to do this. So another call to fprintf() will not read the stringified
number on the next line. I thought I could use:
'fseek (fhandle, len, SEEK_CUR);' where len is the returned value
from a successful call to fprintf()
However, this doesn't work. Instead I prefer to use:
int c;
while ((c = fgetc (fhandle)) != EOF)
{
fputc (c, stdout);
}
Any comments?
Hope this helps.
Michael
----- Original Message -----
From: Johannes Pretorius <joh...@pr...>
To: <dev...@li...>
Sent: Monday, September 03, 2001 10:57 AM
Subject: Re: [Dev-C++] how to use strings
> Do you have some example code. for it seems you know what you want to do
> and have the right functions but something else is wrong. Please give a
> simple app or
> something that you wrote that gives this same problem and we can look at
> it. Futher we can
> only specilate as we dont really know the actual source of the problems
and
> the coding style or mixture being used
>
> Hope we can Help
> Johannes
>
>
> At 11:25 03/09/2001 +0200, you wrote:
> >hi, i am trying to convert a simple integer or byte or anything else
> >to a string in order to write to a file on disk.
> >
> >It does not work the way i did it for years with e.g. Microsoft C7.0
> >(Win3.1) and Visual C 6.0 (W32) - dont know why.
> >
> >a)
> >How do i convert a number liek eg int a = -105 to exactly ythis
> >string ?
> >
> >
> >b) Which function would be the best to write and read the correct
> >format fomr and to HD-Files ?
> >
> >I used to apply fprintf with formatted strings to read full lines of a
file
> >with known structure and directly obtained the desired variables.
> >
> >I copied the source code from a DOS prog and DEV C compiles
> >but reads only shit !
> >
> >Sorry for that, but I am going to get upset with this compiler.
> >
> >Does any body have an example wich directly works in DEV CPP
> >to find out where the problem is ?
> >
> >thanks in progress.
> >...............
> >
> >
> >_______________________________________________
> >Dev-cpp-users mailing list
> >Dev...@li...
> >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Johannes P. <joh...@pr...> - 2001-09-03 13:14:37
|
this here is a simple example that will make more sense. For considering
that you are trying to mix
your WINAPI functions and write to the handle of the file allocators. I do
not think that it is possible in
the compiler version. Maybe with a Microsft compiler.
else this is a VERY simple way to do it that works. I hope this help.,
Please mail if I misunderstand you.
//====== SNIP =========
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
struct test{
char data [200];
}testdata;
void main(void){
char outstring[200];
FILE *fhandle;
int actualnumber;
//open in write mode (override if exist);
fhandle = fopen("c:\\medcelldata.txt","w");
/*CreateFile("c:/medcelldata.txt",
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL
);
*/
if(fhandle == NULL)
{
printf("\nNO File present");
}
//copy test to structuer
strcpy(testdata.data,"Hallo World\n");
actualnumber = 1000;
//write using fwrite (BETTER for Structures)
fwrite(&testdata, sizeof(testdata), 1, fhandle);
//convert integer
itoa(actualnumber, outstring, 10);
//write with fprintf to file
fprintf(fhandle,"OutString : %s",outstring);
//clsoe file
fclose(fhandle);
}
//========= END SNIP =========
Hope it helps
Johannes
At 14:03 03/09/2001 +0200, you wrote:
>On 3 Sep 2001, at 11:57, Johannes Pretorius wrote:
>
> > Johannes Pretorius <joh...@pr...>
>
>
>Here it is ! i allready change something to make it run - but in the
>written file there only occurs 1- or two figures !
>
>How can i use the fprintf - function to access the file ????
>
>
>
>#include <iostream.h>
>#include <stdio.h>
>#include <stdlib.h>
>#include <windows.h>
>
>// vars
>
>HANDLE hcom; // file handler
>HANDLE hfile;
>DWORD dwWritten;
>
>int value[8];
>int numofdata[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} ;
>
>BYTE noise; // for testing only
>BYTE activeitem; // no of active row
>
>BYTE in_buffer[35]; // input buffer = 8 needed
>BYTE out_buffer[35]; // output buffer
>
>int writepoint;
>int readpoint;
>int writepointin; // write pos inbuffer
>int readpointin; // read pos inbuffer
>int goodvalue;
>int tempvalue;
>int actualnumber;
>
>BYTE input;
>BYTE count;
>int globalschleife;
>LPTSTR lpMessage;
>
>int progmode; // bin or asc
>
>
>....
>
> hfile = CreateFile("E:/medcelldata.txt",
> GENERIC_READ | GENERIC_WRITE,
> 0,
> NULL,
> OPEN_ALWAYS,
> FILE_ATTRIBUTE_NORMAL,
> NULL
> );
>
> if(hfile == INVALID_HANDLE_VALUE)
> {
> printf("\nNO File present");
> }
>
> pstr = "MedCellCom 1.2\n\n ";
> WriteFile(hfile, pstr, 16, &dwWritten, NULL);
>
>
> pstr = "Prozess - Protokoll vom : \n ";
>
> WriteFile(hfile, pstr, 27, &dwWritten, NULL);
>
>
> itoa(actualnumber, outstring, 10);
>
> WriteFile(hfile, outstring, 10, &dwWritten, NULL);
>
> WriteFile(hfile, "456", 3, &dwWritten, NULL);
>
> printf("%d\t", dwWritten);
> printf("%s\n", outstring);
>
>
>
>The output shows only
>
> MedCellCom 1.2
>
> Prozess - Protokoll vom :
>2
>
>Where "2" ist the actualnumber
>
>I do not see the 456 test string allthoug the screen
>shows the correct outstring and 3 chars written !
>
>It is a big loop, where many lines are written and
>shown on the screeen it works and the prog terminates.
>
>When writing only dummy strings like explicit
>"iugnuztf" it works and show 200 lines with exactly
>this text !
>
>????
|
|
From: Johannes P. <joh...@pr...> - 2001-09-03 09:56:29
|
Do you have some example code. for it seems you know what you want to do and have the right functions but something else is wrong. Please give a simple app or something that you wrote that gives this same problem and we can look at it. Futher we can only specilate as we dont really know the actual source of the problems and the coding style or mixture being used Hope we can Help Johannes At 11:25 03/09/2001 +0200, you wrote: >hi, i am trying to convert a simple integer or byte or anything else >to a string in order to write to a file on disk. > >It does not work the way i did it for years with e.g. Microsoft C7.0 >(Win3.1) and Visual C 6.0 (W32) - dont know why. > >a) >How do i convert a number liek eg int a = -105 to exactly ythis >string ? > > >b) Which function would be the best to write and read the correct >format fomr and to HD-Files ? > >I used to apply fprintf with formatted strings to read full lines of a file >with known structure and directly obtained the desired variables. > >I copied the source code from a DOS prog and DEV C compiles >but reads only shit ! > >Sorry for that, but I am going to get upset with this compiler. > >Does any body have an example wich directly works in DEV CPP >to find out where the problem is ? > >thanks in progress. >............... > > >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: JS <jsc...@gm...> - 2001-09-03 09:28:17
|
hi, i am trying to convert a simple integer or byte or anything else to a string in order to write to a file on disk. It does not work the way i did it for years with e.g. Microsoft C7.0 (Win3.1) and Visual C 6.0 (W32) - dont know why. a) How do i convert a number liek eg int a = -105 to exactly ythis string ? b) Which function would be the best to write and read the correct format fomr and to HD-Files ? I used to apply fprintf with formatted strings to read full lines of a file with known structure and directly obtained the desired variables. I copied the source code from a DOS prog and DEV C compiles but reads only shit ! Sorry for that, but I am going to get upset with this compiler. Does any body have an example wich directly works in DEV CPP to find out where the problem is ? thanks in progress. ............... |
|
From: lavi <jl...@ne...> - 2001-09-03 06:20:12
|
I Want to unsubscribe HELP HELP Please no more WEB ADD or explanasions Just baill me out |
|
From: Elias P. <eli...@ao...> - 2001-09-02 08:45:26
|
Message> about MINGW 3.x.. I searched a bit on the web and came up with this: > > FROM: yahoo.co.nz > DATE: 08/30/2001 14:37:33 > SUBJECT: RE: [Mingw-users] status of mingw using gcc 3.0.1 You can subscribe to the mingw mailing list at www.mingw.org, or view the complete archives there (including the thread you mention). -- Elias Pschernig |
|
From: Ioannis V. <no...@ya...> - 2001-09-02 04:00:48
|
To anyone concerning about MINGW 3.x.. I searched a bit on the web and came up with this: =20 FROM: yahoo.co.nz DATE: 08/30/2001 14:37:33 SUBJECT: RE: [Mingw-users] status of mingw using gcc 3.0.1=20 =20 --- kevin1 < <http://www.geocrawler.com/contact.php3?to=...@ch...= g s_p_a_m> <EMAIL: PROTECTED>> wrote: > I'm just wondering what the status of gcc 3.0.1 support with mingw > is. I'm > kinda a newbie to the whole business, but I note that the latest > version is > using 2.95.3. Any timeframe on the inclusion of 3.0.1? >=20 When its ready. =20 GCC 3.0.1 builds with mingw host and target - after patching with Mumit Khan's patchset for 3.0. But there are two serious problems, still with 3.0.1 as with 3.0. 1) Dll support for C++ classes is broken. 2) Iostream component of libstdc++ has bugs (cin doesn't work). The first one is a biggy and derives from basic changes in the way attributes are being handled in Gcc 3.x. The second one has a workaround until it is fixed properly - use the STLport iostream lib which has better support for native w32 IO and also has some native locale support.=20 I'll keep working on it, but right now it is not high priority. Regards Danny =20 This means it will take probably much time till we see 3.x and we are stuck with 2.9.x. till that time. =20 =20 =20 Keep coding, Ioannis =20 * Ioannis Vranos * Programming pages: <http://www.noicys.f2s.com/> http://www.noicys.f2s.com * Alternative URL: <http://run.to/noicys> http://run.to/noicys |
|
From: Luigi S. <gi...@li...> - 2001-09-01 17:26:46
|
Hello J.Schuhmacher, I would like to help you but I don't know what the "WriteFile" is, maybe it is some ANSI C/C++ function that I'm missing? Please let me know. If you wish to convert an integer into a string you could use the function "itoa" (Integer TO Array). I've found such a function in the file "stdlib.h" shipped with the mingw compiler (or with Dev-C++) but as far as I remember "itoa" is not an ANSI-C function (of course I may be wrong), so if portability is important to you I suggest you not use it. I use instead a version of "itoa" that can be found at www.geocities.com/gisan1/src_fram.htm/ Hope this helps At 17.22 31/08/01 +0200, you wrote: >Hello, i am using the writefile to place strings into a textfile from a >consol app ! > >The following works normally > >char *pstr; >pstr = "Prozess - Protokoll \n "; >WriteFile(hfile, pstr, 25, &dwWritten, NULL); > >And I also can write value of e.g. "int a" by > >WriteFile(hfile, &a, 1, &dwWritten, NULL); > > >But it appears as one byte only - unreadable in text browser. > >Now, how can I write it in ASCII - ? > >How CAN I convert an e.g. integer to a string ? > >I remember from DOS Programming, there was a function. > >thanks for a hint > >j.s. > > > > > >---------------- >J.Schuhmacher >jsc...@gm... > >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >http://lists.sourceforge.net/lists/listinfo/dev-cpp-users -- gisan gi...@li... |
|
From: Anton T. <ant...@ch...> - 2001-09-01 08:18:13
|
hi, there are several ways to convert an integer to a string, for example char s[80]; int i; i = 123; sprintf(s, "the value of i is: %d\n", i); this copies the text "the value .." to s, and then replaces the "%d" with a string representing i. if you want only the integer to appear in the string, you can remove the rest of the so-called format string and just write sprintf(s, "%d", i) s should be "123", then. you may also concatenate more than one argument: sprintf(s, "i: %d; j: %d", i, j); bye, anti. ----- Original Message ----- From: JS <jsc...@gm...> To: <dev...@li...> Sent: Friday, August 31, 2001 5:22 PM Subject: [Dev-C++] Problem with Writefile > > Hello, i am using the writefile to place strings into a textfile from a > consol app ! > > The following works normally > > char *pstr; > pstr = "Prozess - Protokoll \n "; > WriteFile(hfile, pstr, 25, &dwWritten, NULL); > > And I also can write value of e.g. "int a" by > > WriteFile(hfile, &a, 1, &dwWritten, NULL); > > > But it appears as one byte only - unreadable in text browser. > > Now, how can I write it in ASCII - ? > > How CAN I convert an e.g. integer to a string ? > > I remember from DOS Programming, there was a function. > > thanks for a hint > > j.s. > > > > > > ---------------- > J.Schuhmacher > jsc...@gm... > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: lavi <jl...@ne...> - 2001-08-31 17:36:18
|
----- Original Message -----=20
From: lavi=20
To: dev...@li...=20
Sent: Wednesday, August 29, 2001 11:14 PM
Subject: Re: [Dev-C++] Re: Dev-cpp-users digest, Vol 1 #397 - 5 msgs
HELP I am traying to UNSUBSCRIBE for weeks
Yhanks
----- Original Message -----=20
From: nishikant deshmukh=20
To: dev...@li...=20
Sent: Wednesday, August 29, 2001 4:05 PM
Subject: [Dev-C++] Re: Dev-cpp-users digest, Vol 1 #397 - 5 msgs
remove me=20
dev...@li... wrote:=20
Send Dev-cpp-users mailing list submissions to
dev...@li...
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
or, via email, send a message with subject or body 'help' to
dev...@li...
You can reach the person managing the list at
dev...@li...
When replying, please edit your Subject line so it is more =
specific
than "Re: Contents of Dev-cpp-users digest..."
Today's Topics:
1. (no subject) (=3D?iso-8859-2?Q?Ivan_Ganick=3DFD?=3D)
2. strftime and << binaries (float) (JohnG)
3. blocking user's access (Alex Badiu)
4. Re: Dev-c++ and array ! (Luigi Santillo)
5. Re: Dev-cpp-users digest, Vol 1 #396 - 1 msg (nishikant =
deshmukh)
--__--__--
Message: 1
From: =3D?iso-8859-2?Q?Ivan_Ganick=3DFD?=3D=20
To:=20
Date: Mon, 27 Aug 2001 23:03:33 +0200
Subject: [Dev-C++] (no subject)
Reply-To: dev...@li...
This is a multi-part message in MIME format.
------=3D_NextPart_000_0026_01C12F4C.7EB510A0
Content-Type: text/plain;
charset=3D"iso-8859-2"
Content-Transfer-Encoding: quoted-printable
------=3D_NextPart_000_0026_01C12F4C.7EB510A0
Content-Type: text/html;
charset=3D"iso-8859-2"
Content-Transfer-Encoding: quoted-printable
charset=3D3Diso-8859-2">
------=3D_NextPart_000_0026_01C12F4C.7EB510A0--
--__--__--
Message: 2
From: "JohnG"=20
To: "DEVCPP_List"=20
Date: Mon, 27 Aug 2001 18:08:03 -0500
Subject: [Dev-C++] strftime and << binaries (float)
Reply-To: dev...@li...
Has anyone attempted to put a strftime string along with a float =
on the =3D
same line? I'm attempting to use a string output from the strftime =
=3D
function and also a float together. I get error messages stating =
that =3D
the float cannot be joined with the string. =3D20
John Garrison
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--__--__--
Message: 3
Date: Mon, 27 Aug 2001 20:57:23 +0300
From: Alex Badiu=20
To: Dev-C++ List=20
Subject: [Dev-C++] blocking user's access
Reply-To: dev...@li...
--------------953F0CFEB40E4B159A352973
Content-Type: text/plain; charset=3Diso-8859-2
Content-Transfer-Encoding: 7bit
Hello.
I want to make a program that blocks the access to a PC unless a
password is provided. The thing is that I don't know how. I've =
seen
something that went fullscreen and in one corner there was a small =
login
box with the user and password fields. Wasn't DirectX or anything =
like
that. Just GDI. Alt-TAB wasn't working and when doing Ctrl-Alt-Del =
the
program wasn't in the Close program list.
Does anyone have a clue about how would I do this?
Thanks in advance.
Alex Badiu
http://www.badiu.net
http://queen.badiu.net
--------------953F0CFEB40E4B159A352973
Content-Type: text/html; charset=3Diso-8859-2
Content-Transfer-Encoding: 7bit
Hello.
I want to make
a program that blocks the access to a PC unless a password is =
provided.
The thing is that I don't know how. I've seen something that went =
fullscreen
and in one corner there was a small login box with the user and =
password
fields. Wasn't DirectX or anything like that. Just GDI. Alt-TAB =
wasn't
working and when doing Ctrl-Alt-Del the program wasn't in the =
Close program
list.
Does anyone have
a clue about how would I do this?
Thanks in advance.
Alex Badiu
http://www.badiu.net
http://queen.badiu.net
--------------953F0CFEB40E4B159A352973--
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--__--__--
Message: 4
Date: Mon, 27 Aug 2001 08:26:39 +0200
To: dev...@li...
From: Luigi Santillo=20
Subject: Re: [Dev-C++] Dev-c++ and array !
Reply-To: dev...@li...
Hi!
Sorry, my answer was a little confusing, I wrote it after =
compiling this=20
small example:
test.c
------
=
/*********************************************************************
test things like: int tab[10, 2]
=
*********************************************************************/
#include=20
void
print_arr(const int *, int);
=
/********************************************************************/
int
main()
{
int x;
int tab[10, 2];
x =3D 1, printf("x =3D %d\n", x);
tab[0] =3D 1;
tab[1] =3D 10;
print_arr(tab, 2);
return 0;
}
=
/********************************************************************/
void
print_arr(const int *arr, int n)
{
int i;
for(i =3D 0; i < n; i++)
printf("arr[%d] =3D %d\n", i, arr[i]);
}
---
When you compile it you should see the message:
test.c:17: warning left-hand operand of comma has no effect
So "do something with 10 (actually nothing)" was my pesonal =
translation
of the above warning message. :-)
At 15.03 26/08/01 +0200, you wrote:
> > In the same fashion, the "int Tab[10, 2]" means: do "something =
with 10"
> > (actually nothing) and allocate memory (in static sense) for =
an array of 2
> > integers.
>
>Do something with 10 ? Doing what ?
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
--
gisan
gi...@li...
--__--__--
Message: 5
Date: Mon, 27 Aug 2001 22:38:09 -0700 (PDT)
From: nishikant deshmukh=20
To: dev...@li...
Subject: [Dev-C++] Re: Dev-cpp-users digest, Vol 1 #396 - 1 msg
Reply-To: dev...@li...
--0-1804528721-998977089=3D:30937
Content-Type: text/plain; charset=3Dus-ascii
remove me.
dev...@li... wrote: Send =
Dev-cpp-users mailing list submissions to
dev...@li...
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
or, via email, send a message with subject or body 'help' to
dev...@li...
You can reach the person managing the list at
dev...@li...
When replying, please edit your Subject line so it is more =
specific
than "Re: Contents of Dev-cpp-users digest..."
Today's Topics:
1. RE: Pointer Resourses (Ioannis Vranos)
-- __--__--=20
Message: 1
From: "Ioannis Vranos"=20
To:=20
Subject: RE: [Dev-C++] Pointer Resourses
Date: Mon, 27 Aug 2001 16:39:20 +0200
Reply-To: dev...@li...
You forgot to mention the phrase "second edition". :)
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...=3D20
> [mailto:dev...@li...] On Behalf Of =
bretek
> Sent: Monday, August 27, 2001 1:00 PM
> To: cha...@ho...
> Cc: dev...@li...
> Subject: RE: [Dev-C++] Pointer Resourses
>=3D20
>=3D20
> Hello!
>=3D20
> Pointer is a datatype that's value is a memory address.
> It is necessary in C programming because C is a pointer=3D20
> oriented language. In addition it is very useful in=3D20
> handling of trees, lists etc.
> A VERY useful book (not only for you but for all C=3D20
> programmers) :
> Kernighan,Brian W. ; Ritchie, Dennis M. : "The C=3D20
> programming language."
>=3D20
>=3D20
>=3D20
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=3D20
-- __--__--=20
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
End of Dev-cpp-users Digest
---------------------------------
Do You Yahoo!?
Make international calls for as low as $0.04/minute with Yahoo! =
Messenger.
--0-1804528721-998977089=3D:30937
Content-Type: text/html; charset=3Dus-ascii
remove me.
dev...@li... wrote:=20
Send Dev-cpp-users mailing list submissions to
dev...@li...
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
or, via email, send a message with subject or body 'help' to
dev...@li...
You can reach the person managing the list at
dev...@li...
When replying, please edit your Subject line so it is more =
specific
than "Re: Contents of Dev-cpp-users digest..."
Today's Topics:
1. RE: Pointer Resourses (Ioannis Vranos)
-- __--__--=20
Message: 1
From: "Ioannis Vranos"=20
To:=20
Subject: RE: [Dev-C++] Pointer Resourses
Date: Mon, 27 Aug 2001 16:39:20 +0200
Reply-To: dev...@li...
You forgot to mention the phrase "second edition". :)
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...=3D20
> [mailto:dev...@li...] On Behalf =
Of bretek
> Sent: Monday, August 27, 2001 1:00 PM
> To: cha...@ho...
> Cc: dev...@li...
> Subject: RE: [Dev-C++] Pointer Resourses
>=3D20
>=3D20
> Hello!
>=3D20
> Pointer is a datatype that's value is a memory address.
> It is necessary in C programming because C is a pointer=3D20
> oriented language. In addition it is very useful in=3D20
> handling of trees, lists etc.
> A VERY useful book (not only for you but for all C=3D20
> programmers) :
> Kernighan,Brian W. ; Ritchie, Dennis M. : "The C=3D20
> programming language."
>=3D20
>=3D20
>=3D20
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=3D20
-- __--__--=20
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
End of Dev-cpp-users Digest
-------------------------------------------------------------------------=
-
Do You Yahoo!?
Make international calls for as low as $0.04/minute with Yahoo! =
Messenger.
--0-1804528721-998977089=3D:30937--
--__--__--
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
End of Dev-cpp-users Digest
-------------------------------------------------------------------------=
---
Do You Yahoo!?
Make international calls for as low as $0.04/minute with Yahoo! =
Messenger.
|
|
From: JS <jsc...@gm...> - 2001-08-31 15:52:04
|
Hello, i am using the writefile to place strings into a textfile from a consol app ! The following works normally char *pstr; pstr = "Prozess - Protokoll \n "; WriteFile(hfile, pstr, 25, &dwWritten, NULL); And I also can write value of e.g. "int a" by WriteFile(hfile, &a, 1, &dwWritten, NULL); But it appears as one byte only - unreadable in text browser. Now, how can I write it in ASCII - ? How CAN I convert an e.g. integer to a string ? I remember from DOS Programming, there was a function. thanks for a hint j.s. ---------------- J.Schuhmacher jsc...@gm... |