dev-cpp-users Mailing List for Dev-C++ (Page 401)
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: Daniel K. O. <dan...@ya...> - 2003-04-11 14:33:11
|
Just wondering, which version is in that DevPack? Still the 2.0.0? Or 2.2.1? Daniel K. O. > -----Mensagem original----- > De: dev...@li... > [mailto:dev...@li...]Em nome de David > Matthews > Enviada em: quinta-feira, 10 de abril de 2003 23:36 > Para: Flávio de Souza; Dev-Cpp > Assunto: Re: [Dev-C++] GTK + step by step HOW-TO > > > Did you download the GTK+ devpak? You can get it on > http:\\www.bloodshed.net\dev\ in the package repository. It > has a built in > template with all compiler flags, it also has all the correct libs and > headers. |
|
From: David M. <dem...@uw...> - 2003-04-11 11:27:43
|
Did you download the GTK+ devpak? You can get it on http:\\www.bloodshed.net\dev\ in the package repository. It has a built in template with all compiler flags, it also has all the correct libs and headers. At 07:31 PM 10/04/2003 -0300, Fl=E1vio de Souza wrote: >Dear Sirs: > >I would like to use GTK+ with Dev-Cpp.=20 > >I downloaded the newest Dev-Cpp version, however I do >not know how to integrate GTK+ with Dev-Cpp. > >In the following web site >http://www.gimp.org/~tml/gimp/win32/ >I got many libs and files, I am completely lost! > >I need help and directions on which files I have to >download. >Then I step by step procedure on how to integrate it. >compiler flags, etc. > >I tried to browse this list files, but I could not get >clear information ( at least to me ) on how to do >that. > >I promisse that If I could get through this, I will >place a HOW-TO on the web and I will sent it to >integrate to Dev-Cpp help. > >Please, help me! > >Regards, > >Fl=E1vio. > >=3D=3D=3D=3D=3D >Flavio de Souza >fla...@ya... >Sert=E3ozinho - SP - Brasil >Yahoo! ID: flaviostz > >_______________________________________________________________________ >Yahoo! Mail >O melhor e-mail gratuito da internet: 6MB de espa=E7o, antiv=EDrus, acesso POP3, filtro contra spam.=20 >http://br.mail.yahoo.com/ > > >------------------------------------------------------- >This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger= =20 >for complex code. Debugging C/C++ programs can leave you feeling lost and= =20 >disoriented. TotalView can help you find your way. Available on major UNIX= =20 >and Linux platforms. Try it free. www.etnus.com >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Ioannis V. <iv...@at...> - 2003-04-11 11:13:35
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Andrι Macαrio Barros
> Sent: Friday, April 11, 2003 8:34 AM
> To: Dev-Cpp-Users
> Subject: [Dev-C++] scanf with gets
>
>
> Dear programmers,
>
> I´m having to use the fflush command in the following code:
>
> #include <stdio.h>
> #include <stdlib.h>
>
> int main()
> {
> char name[10];
> int a, b, c;
>
> printf("Enter a-->");
> scanf("%d", &a);
> printf("Enter some name-->");
> fflush(stdin);
The behaviour of the above is undefined (e.g. the airplane may crash).
fflush() is intended to be used on output streams.
You can simply do:
getchar();
> gets(name);
Extremelly Dangerous for buffer overflow (that is you must trust the user
very well, and he user must know the internals of your code). A better one:
fgets(name,10,stdin);
> printf("Enter com b-->");
> scanf("%d", &b);
> printf("The sum of %d with %d is %d\n", a, b, a+b);
> printf("And the name typed was %s\n", name);
> system("PAUSE");
> return 0;
> }
>
> The reason is that if I don´t put it, the program doesn´t
> wait for the name
> to be typed via keyboard. It passes directly to the other operator, b,
> indicating that the input buffer is loaded with something. I made some
> experiments with short int (hd), but nothing solved.
>
> 1-Can anyone explain what is happening?
scanf() leaves the '\n' on the stream. Then gets() was reading and
interpreting it as if you entered an empty string.
> 2-What is the solution for don´t use the fflush?
getchar(); or something. You can even do a function in the style:
void clean_stdin()
{
while(getchar()!='\n')
;
}
And use it. If you are going to use it with stream redirection in the style
myprogram <whatever.txt
for example,
you have to get EOF into account.
Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
Anti-racism movement: http://www.positive-youthfoundation.org
Iraq Peace Pledge: http://www.peacepledge.org
|
|
From: Per W. <pw...@ia...> - 2003-04-11 10:58:42
|
But fflush() is not portable for input streams! It is only indended for flushing output streams. On a Linux, it would return EOF and set errno to EBADF if the stream isn't opened for output. /Per W On Fri, 11 Apr 2003, Ricardo L=F3pez Ruiz wrote: > scanf ( ) doesnot read the 'return' char, > then it stays in the input buffer until the next reading. > Two options for the next sentence: > (1) If you read in the next sentence with gets( ) > the 'return' char is transformed in the > empty char string: " " =3D '\0' . > (2) If you read a char in the next sentence with scanf( ) > the 'return' char it is transformed in the 'line jump'=3D'\n'. > > In consequence, if you dont want any strange/side effect in your input > the best option I know after an entry with scanf( ) it's to free the > input buffer: > > fflush(stdin). > > > Any other explanation is wellcome, > but I hope it can help you, > Ricardo. > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of TotalView, The debugg= er > for complex code. Debugging C/C++ programs can leave you feeling lost and > disoriented. TotalView can help you find your way. Available on major UNI= X > and Linux platforms. Try it free. www.etnus.com > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Ricardo R. <ri...@un...> - 2003-04-11 09:38:58
|
scanf ( ) doesnot read the 'return' char,
then it stays in the input buffer until the next reading.
Two options for the next sentence:
(1) If you read in the next sentence with gets( )
the 'return' char is transformed in the
empty char string: " " = '\0' .
(2) If you read a char in the next sentence with scanf( )
the 'return' char it is transformed in the 'line jump'='\n'.
In consequence, if you dont want any strange/side effect in your input
the best option I know after an entry with scanf( ) it's to free the
input buffer:
fflush(stdin).
Any other explanation is wellcome,
but I hope it can help you,
Ricardo.
|
|
From: supperbeyond <sup...@16...> - 2003-04-11 06:22:15
|
PkZyb206ICJsYW1vbnQiIDxsYW1vbnQubmVsc29uQHZlcml6b24ubmV0Pg0KPlRvOiA8ZGV2LWNw cC11c2Vyc0BsaXN0cy5zb3VyY2Vmb3JnZS5uZXQ+DQo+RGF0ZTogV2VkLCA5IEFwciAyMDAzIDIz OjU5OjMxIC0wNzAwDQo+U3ViamVjdDogW0Rldi1DKytdIGRpcmVjdG9yeSBJTw0KDQo+aXMgdGhl cmUgYSB3YXkgaW4gQU5TSSBDKysgdG8gbWFuaXB1bGF0ZSBkaXJlY3Rvcmllcz8/IElmIG5vdCwg YXJlIHRoZXJlID5hbnkNCj5mdW5jdGlvbnMvY2xhc3NlcyBpbiBEZXYtY3BwIHRoYXQgY2FuIGRv IGl0Pw0KDQo+VGhhbmtzLg0KDQpZb3UgY2FuIHRyeSBCb29zdCBMaWJyYXJ5J3MgY29tcG9uZW1l bnQgZmlsZXN5c3RlbS5JdCBpcyBib29zdDo6ZmlsZXN5c3RlbQ0KWW91IGNhbiBmaW5kIGl0IGhl cmUgaHR0cDovL3d3dy5ib29zdC5vcmcNCg0KR29vZCBsdWNrLl5fXg0KDQo= |
|
From: <and...@su...> - 2003-04-11 05:34:23
|
Dear programmers,
I´m having to use the fflush command in the following code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char name[10];
int a, b, c;
printf("Enter a-->");
scanf("%d", &a);
printf("Enter some name-->");
fflush(stdin);
gets(name);
printf("Enter com b-->");
scanf("%d", &b);
printf("The sum of %d with %d is %d\n", a, b, a+b);
printf("And the name typed was %s\n", name);
system("PAUSE");
return 0;
}
The reason is that if I don´t put it, the program doesn´t wait for the name
to be typed via keyboard. It passes directly to the other operator, b,
indicating that the input buffer is loaded with something. I made some
experiments with short int (hd), but nothing solved.
1-Can anyone explain what is happening?
2-What is the solution for don´t use the fflush?
Regards
Andre
|
|
From: Daniel K. O. <dan...@ya...> - 2003-04-11 03:07:51
|
> In the following web site > http://www.gimp.org/~tml/gimp/win32/ > I got many libs and files, I am completely lost! > I need help and directions on which files I have to > download. You need the dev files for GTK+ 2.2.1; this one requires glib, atk, pango, zlib, libpng, libjpeg and libtiff (this is written on that page), so you also need to download them (the dev version, if there's more than one). Unzip everything on dev-cpp's directory (or under MinGW's directory, if you have it installed somewhere else); > Then I step by step procedure on how to integrate it. > compiler flags, etc. Download the pkg-config too; if you use a unix-like shell (like MSYS) you can use it to compile your gtk programs, like on the Gtk documentation: gcc program.c -o program.exe `pkg-config gtk+-2.0 --libs --cflags` If you don't want to use a shell to compile your programs, you'll need to copy/paste the output for: C (or C++) Compiler Flags: pkg-config gtk+-2.0 --cflags (it will return something like: -IC:/DEV-CPP/include/gtk-2.0 -IC:/DEV-CPP/lib/gtk-2.0/include -IC:/DEV-CPP/include/atk-1.0 -IC:/DEV-CPP/include/pango-1.0 -IC:/DEV-CPP/include/glib-2.0 -IC:/DEV-CPP/lib/glib-2.0/include ) Linker Options: pkg-config gtk+-2.0 --libs (will be something like: -LC:/DEV-CPP/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv ) So, you can copy/paste it on a GTK+ project on Dev-Cpp. Oh, one more thing: add the "-mms-bitfields" to the C/C++ flags. Optionally, you can use this as your GTK+ Template (I use this one): - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - [Template] ver=1 Name=GTK Icon=Gtk.ico Description=Create a GUI using Gtk. Catagory=GUI [Unit0] C=Gtk.txt Cpp=Gtk.txt CName=main.c CppName=main.cpp [Project] UnitCount=1 Type=0 IsCpp=0 Compiler=-mms-bitfields_@@_-I"<INCLUDE>\glib-2.0"_@@_-I"<INCLUDE>\atk-1.0"_@ @_-I"<INCLUDE>\gtk-2.0"_@@_-I"<INCLUDE>\pango-1.0"_@@_-I"<LIB>\glib-2.0\incl ude"_@@_-I"<LIB>\gtk-2.0\include" CppCompiler=-mms-bitfields_@@_-I"<INCLUDE>\glib-2.0"_@@_-I"<INCLUDE>\atk-1.0 "_@@_-I"<INCLUDE>\gtk-2.0"_@@_-I"<INCLUDE>\pango-1.0"_@@_-I"<LIB>\glib-2.0\i nclude"_@@_-I"<LIB>\gtk-2.0\include" Linker=-lgtk-win32-2.0_@@_-lgdk-win32-2.0_@@_-latk-1.0_@@_-lgdk_pixbuf-2.0_@ @_-lpangowin32-1.0_@@_-lgdi32_@@_-lpango-1.0_@@_-lgobject-2.0_@@_-lgmodule-2 .0_@@_-lglib-2.0_@@_-lintl_@@_-liconv Name=GTK+ Project ProjectIcon=Gtk.ico - >8 - >8 - >8 - >8 - >8 - >8 - >8 - >8 - >8 - >8 - >8 - >8 - The "Gtk.txt" file contains a small sample, that I use for almost every GTK+ program: ---- #include <gtk/gtk.h> GtkWidget *win; int main(int argc, char *argv[]) { gtk_init(&argc, &argv); win = gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(gtk_main_quit), NULL); gtk_widget_show(win); gtk_main(); } --- > I tried to browse this list files, but I could not get > clear information ( at least to me ) on how to do > that. I answered this question a few times here, but I'll forgive you, the search engine on SourceForge is broken... :) Daniel K. O. Only ask questions with yes/no answers if you want "yes" or "no" as the answer. http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-an swers.html |
|
From: jose i. c. <ji...@fr...> - 2003-04-11 02:26:04
|
Yes I was... Thanks Ioannis. thanks. > > Per, > > > > > // Need to return a pointer to text, not just a single character. > > > char* FileContent(char *file) > > > > this worked! Thanks! I had the code correct, but I was > > returning a string > > instead of a string pointer. > > > > For accuracy you were returning a char. |
|
From: <fla...@ya...> - 2003-04-10 22:32:44
|
Dear Sirs: I would like to use GTK+ with Dev-Cpp. I downloaded the newest Dev-Cpp version, however I do not know how to integrate GTK+ with Dev-Cpp. In the following web site http://www.gimp.org/~tml/gimp/win32/ I got many libs and files, I am completely lost! I need help and directions on which files I have to download. Then I step by step procedure on how to integrate it. compiler flags, etc. I tried to browse this list files, but I could not get clear information ( at least to me ) on how to do that. I promisse that If I could get through this, I will place a HOW-TO on the web and I will sent it to integrate to Dev-Cpp help. Please, help me! Regards, Flávio. ===== Flavio de Souza fla...@ya... Sertãozinho - SP - Brasil Yahoo! ID: flaviostz _______________________________________________________________________ Yahoo! Mail O melhor e-mail gratuito da internet: 6MB de espaço, antivírus, acesso POP3, filtro contra spam. http://br.mail.yahoo.com/ |
|
From: jordan v. <j_...@ya...> - 2003-04-10 17:05:21
|
Had anyone precompile dev-c++(linux version) for qt3??? __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more http://tax.yahoo.com |
|
From: David M. <dem...@uw...> - 2003-04-10 12:45:53
|
Looks like an erroneus character was inserted by the mailing list. Ignore
it and any other '3D's you see. The =s are supposed to be there.
At 11:24 PM 09/04/2003 -0700, lamont wrote:
>>Looks like what you actually want is something like this:
>
>>char *FileContent(file *fp)
>>{
>> char *buf;
>> // Open the file...
>> int i =3D fseek(fp, SEEK_END) + 1;
>> buf =3D malloc(sizeof(i));
>> fseek(fp, SEEK_SET);
>> for(char ch =3D fgetc(fp); ch !=3D EOF; buf++ =3D ch);
>> return buf;
>>}
>
>
>What does the '=3D' do in the above function??
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
>for complex code. Debugging C/C++ programs can leave you feeling lost and
>disoriented. TotalView can help you find your way. Available on major UNIX
>and Linux platforms. Try it free. www.etnus.com
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Ioannis V. <iv...@at...> - 2003-04-10 08:19:33
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf Of lamont > Sent: Thursday, April 10, 2003 10:00 AM > To: dev...@li... > Subject: [Dev-C++] directory IO > > > is there a way in ANSI C++ to manipulate directories?? No. You will have to depend on local libraries. >If > not, are there any > functions/classes in Dev-cpp that can do it? The Win32 API. However someone else can give you more information on that. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: Ioannis V. <iv...@at...> - 2003-04-10 08:16:46
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of jose isaias cabrera > Sent: Thursday, April 10, 2003 4:21 AM > To: Per Westermark; Ioannis Vranos > Cc: Dev-C++ Mailing List > Subject: Re: [Dev-C++] passing the content of a string to a > variable from > > > > Per, > > > // Need to return a pointer to text, not just a single character. > > char* FileContent(char *file) > > this worked! Thanks! I had the code correct, but I was > returning a string > instead of a string pointer. For accuracy you were returning a char. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: Per W. <pw...@ia...> - 2003-04-10 06:16:16
|
There are mail encodings that uses a '=' and some more characters to
encode non-printable characters. Since the '=' is a break character, a
normal '=' must then also be encoded - in this case with '=3D'.
The mail sender program - or your receiving program - failed to process
this encoding correctly. Wherever you see '=3D' the real text just
contains an '=' character.
One issue with the '=xx' encoding is that some versions of mail
encoders (I think of M$ brand) forgets to convert the single '=' to
'=3D' breaking a lot of decoding software.
/Per W
On Wed, 9 Apr 2003, lamont wrote:
> >Looks like what you actually want is something like this:
>
> >char *FileContent(file *fp)
> >{
> > char *buf;
> > // Open the file...
> > int i =3D fseek(fp, SEEK_END) + 1;
> > buf =3D malloc(sizeof(i));
> > fseek(fp, SEEK_SET);
> > for(char ch =3D fgetc(fp); ch !=3D EOF; buf++ =3D ch);
> > return buf;
> >}
>
>
> What does the '=3D' do in the above function??
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
> for complex code. Debugging C/C++ programs can leave you feeling lost and
> disoriented. TotalView can help you find your way. Available on major UNIX
> and Linux platforms. Try it free. www.etnus.com
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: lamont <lam...@ve...> - 2003-04-10 03:56:02
|
is there a way in ANSI C++ to manipulate directories?? If not, are there any functions/classes in Dev-cpp that can do it? Thanks. -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of dev...@li... Sent: Wednesday, April 09, 2003 8:07 AM To: dev...@li... Subject: Dev-cpp-users digest, Vol 1 #1399 - 11 msgs Send Dev-cpp-users mailing list submissions to dev...@li... To subscribe or unsubscribe via the World Wide Web, visit https://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: RES: [Dev-C++] NewBie (Ioannis Vranos) 2. RE: passing the content of a string to a variable from (Ioannis Vranos) 3. RE: passing the content of a string to a variable from (Per Westermark) 4. Re: linker error (Neszt Tibor) 5. Re: Creating a static library (Daniel Glenfield) 6. Dll (Nambiar, Vivek (Cognizant)) 7. =?iso-8859-1?Q?Dev-C++_doesn=B4t_find_my_libs?= (Michael Stather) 8. RE: passing the content of a string to a variable from (Ioannis Vranos) 9. Re: passing the content of a string to a variable from (David Matthews) 10. Re: passing the content of a string to a variable from (Per Westermark) --__--__-- Message: 1 From: "Ioannis Vranos" <iv...@at...> To: "Dev-C++ Mailing List" <dev...@li...> Subject: RE: RES: [Dev-C++] NewBie Date: Wed, 9 Apr 2003 06:52:36 +0300 Or he could use Allegro or something (I assume that Allegro works with MINGW). Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Per Westermark > Sent: Wednesday, April 09, 2003 12:42 AM > To: Daniel K. O. > Cc: dev...@li... > Subject: Re: RES: [Dev-C++] NewBie > > > djgpp is a nice DOS compiler. --__--__-- Message: 2 From: "Ioannis Vranos" <iv...@at...> To: "Dev-C++ Mailing List" <dev...@li...> Date: Wed, 9 Apr 2003 07:00:08 +0300 Subject: RE: [Dev-C++] passing the content of a string to a variable from > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of jose isaias cabrera > Sent: Wednesday, April 09, 2003 4:52 AM > To: dev...@li... > Subject: [Dev-C++] passing the content of a string to a variable from > > > > Greetings O SmartOnes! > > I have the following c code: > > char FileContent(char *file) > { > char fcontent(3000); > ... > /*in here I grab the content of a text file */ > ... > return(fcontent); > } I assume C: > > int main(int argc, char *argv[]) > { > char text[3000]; > ... > ... > ... > text = FileContent("temp.txt"); FileContent returns a char. You assign it to an array which is not proper. If you intend it to return a char, you have to do something like: text[0]=FileContent("temp.txt"); If you made a mistake and intend to return a char * you have either to do: char *text; /* ... */ text=FileContent("temp.txt"); or char text[3000]; char *p; /* ... */ p=FileContent("temp.txt"); strncpy(text, p, 3000); text[2999]='\0'; > } > > I can't get this to work. I've a bunch of places and I even > tried to get > the pointers to no avail. I am new to c, but I am an expert > programmer. > Any c help will be greatly appreciated. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org --__--__-- Message: 3 Date: Wed, 9 Apr 2003 09:01:35 +0200 (CEST) From: Per Westermark <pw...@ia...> To: Ioannis Vranos <iv...@at...> cc: Dev-C++ Mailing List <dev...@li...> Subject: RE: [Dev-C++] passing the content of a string to a variable from See below. /Per W On Wed, 9 Apr 2003, Ioannis Vranos wrote: > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...] On Behalf > > Of jose isaias cabrera > > Sent: Wednesday, April 09, 2003 4:52 AM > > To: dev...@li... > > Subject: [Dev-C++] passing the content of a string to a variable from > > > > > > > > Greetings O SmartOnes! > > > > I have the following c code: > > > > char FileContent(char *file) // Need to return a pointer to text, not just a single character. char* FileContent(char *file) > > { > > char fcontent(3000); // Array size should be in [] // You may never return address of a variable declared on stack. // As soon as the FileContent() returns, the fcontent buffer would // be deleted unless it's declared static, which will store // fcontent as a global variable but only available within name // space of FileContent(). static char fcontent[3000]; > > ... > > /*in here I grab the content of a text file */ > > ... > > return(fcontent); > > } > > > I assume C: > > > > > > > int main(int argc, char *argv[]) > > { > > char text[3000]; // If FileContent already keeps the full text content, no need for one // more buffer. Just keep track of a pointer to the text. // Besides, it isn't possible to assign an array to an array. As Ioannis // shows below, if you really wants to copy the contents of an array to // another array, you have to call strcpy(), strncpy(), memcpy(), // memmove() or similar. // char *text; > > ... > > ... > > ... > > text = FileContent("temp.txt"); > > > > FileContent returns a char. You assign it to an array which is not proper. > If you intend it to return a char, you have to do something like: > > text[0]=FileContent("temp.txt"); > > > If you made a mistake and intend to return a char * you have either to do: > > > char *text; > > /* ... */ > > text=FileContent("temp.txt"); > > > or > > > char text[3000]; > char *p; > > /* ... */ > > p=FileContent("temp.txt"); > > strncpy(text, p, 3000); > > text[2999]='\0'; > > > > > > } > > > > I can't get this to work. I've a bunch of places and I even > > tried to get > > the pointers to no avail. I am new to c, but I am an expert > > programmer. > > Any c help will be greatly appreciated. > > > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > Anti-racism movement: http://www.positive-youthfoundation.org > Iraq Peace Pledge: http://www.peacepledge.org > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > --__--__-- Message: 4 Date: Wed, 9 Apr 2003 08:51:20 +0200 (MET DST) From: Neszt Tibor <ne...@ss...> To: Szathmary Laszlo <sz...@de...> Cc: dev...@li... Subject: Re: [Dev-C++] linker error Hello! > Thanks for the info, I didn't know that. I have two files in lib: tiff.lib > and libtiff.a > I tried to add tiff.lib as "../../DevCpp5/lib/tiff.lib", but when I want > to run it, it says it cannot load libtiff.dll > How can I fix it? When You have a lib*.a, you have to tell to the compiler, You want to use it. So in the "Project Options" / "Parameters" / "Linker" fill a new line: -l* In Your case: -ltiff Regards, Neszt Tibor p.s.: Remelem sikerul :-) --__--__-- Message: 5 From: "Daniel Glenfield" <sp...@ho...> To: dem...@uw..., dev...@li... Subject: Re: [Dev-C++] Creating a static library Date: Wed, 09 Apr 2003 11:06:20 +0100 Here's a link my friend sent me - guess I wasn't of much help lol! http://www.nps.navy.mil/cs/sullivan/CS3971/LibTutorial.html >From: David Matthews <dem...@uw...> >To: Daniel Glenfield <sp...@ho...>, >dev...@li... >Subject: Re: [Dev-C++] Creating a static library >Date: Tue, 08 Apr 2003 14:14:03 -0400 > >Well, I'm assuming that you mean the .a files are just a collection of .o >files. That's not what they are, they have their own format. You can >probably find out more on google. > >At 11:30 AM 08/04/2003 -0400, David Matthews wrote: > >Well someone asked me how (they are using VC++) so I guess it's along >those > >lines in another compiler huh? > > > >The library...that's the .cpp files compiled isn't it? and you #include >the > >header and then just call them, yes? > > > >Daniel > > > > > >>From: David Matthews <dem...@uw...> > >>To: "Daniel Glenfield" <sp...@ho...>, > >>dev...@li... > >>Subject: Re: [Dev-C++] Creating a static library > >>Date: Mon, 07 Apr 2003 14:32:37 -0400 > >> > >>New project, static library. Add the source files to the project, >compile > >>as lib<yourname>.a drop the new .a library into your /lib/ directory. >In > >>another project, go to linker options, add -l<yourname> and #include > >><yourname>.h > >> > >>At 04:52 PM 07/04/2003 +0100, Daniel Glenfield wrote: > >> >How can I create a static library? > >> > > >> >Sorry if this is obvious, can't think today! > >> > > >> > > >> > > >> > > >> > > >> >_________________________________________________________________ > >> >It's fast, it's easy and it's free. Get MSN Messenger today! > >> >http://www.msn.co.uk/messenger > >> > > >> > > >> > > >> >------------------------------------------------------- > >> >This SF.net email is sponsored by: ValueWeb: > >> >Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > >> >No other company gives more support or power for your dedicated server > >> >http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > >> >_______________________________________________ > >> >Dev-cpp-users mailing list > >> >Dev...@li... > >> >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > >> >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > >> > > > > > > >_________________________________________________________________ > >Use MSN Messenger to send music and pics to your friends > >http://www.msn.co.uk/messenger > > > > > > > > >------------------------------------------------------- >This SF.net email is sponsored by: ValueWeb: >Dedicated Hosting for just $79/mo with 500 GB of bandwidth! >No other company gives more support or power for your dedicated server >http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Surf together with new Shared Browsing http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID=74&DI=1059 --__--__-- Message: 6 Date: Wed, 9 Apr 2003 16:04:50 +0530 From: "Nambiar, Vivek (Cognizant)" <nv...@Ch...> To: <dev...@li...> Subject: [Dev-C++] Dll This is a multi-part message in MIME format. ------=_NextPartTM-000-be2e9920-a104-4e47-b847-e7fdc1a6f19b Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2FE83.A6869E2A" ------_=_NextPart_001_01C2FE83.A6869E2A Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Can anybody explain in short step by step how to build a DLL in dev c++ specially the "def part" regards vivek ------_=_NextPart_001_01C2FE83.A6869E2A Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Diso-8859-1"> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 6.0.6249.1"> <TITLE>Dll</TITLE> </HEAD> <BODY> <!-- Converted from text/rtf format --> <P><FONT SIZE=3D2 FACE=3D"Verdana">Hi,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Verdana">Can anybody explain in short step by = step how to build a DLL in dev c++</FONT> <BR><FONT SIZE=3D2 FACE=3D"Verdana">specially the "def = part"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Verdana">regards</FONT> <BR><FONT SIZE=3D2 FACE=3D"Verdana">vivek</FONT> </P> <BR> </BODY> </HTML> ------_=_NextPart_001_01C2FE83.A6869E2A-- ------=_NextPartTM-000-be2e9920-a104-4e47-b847-e7fdc1a6f19b Content-Type: text/plain; name="InterScan_Disclaimer.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="InterScan_Disclaimer.txt" This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. Visit us at http://www.cognizant.com ------=_NextPartTM-000-be2e9920-a104-4e47-b847-e7fdc1a6f19b-- --__--__-- Message: 7 Reply-To: "Michael Stather" <ko...@mi...> From: "Michael Stather" <mic...@nu...> To: <dev...@li...> Date: Wed, 9 Apr 2003 13:00:38 +0200 Subject: [Dev-C++] =?iso-8859-1?Q?Dev-C++_doesn=B4t_find_my_libs?= This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C2FE98.0448A8F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, trying to compile a simple SDL-Sample results in this: g++.exe Main.o -o "Template.exe" -L"C:/dev/Dev-Cpp/lib" = -L"C:/dev/wx/lib" -L"C:/dev/wx/contrib/lib" -L"C:/dev/SDL/lib" SDL.lib = SDLmain.lib g++.exe: SDL.lib: No such file or directory g++.exe: SDLmain.lib: No such file or directory make.exe: *** [Template.exe] Error 1 However, SDL.lib and SDLmain.lib are present in C:\dev\SDL\lib, which is = also entered in the compiler options. This occurs with all libs, also wxWindows and other toolkits. Can somebody help me?? PS: I=B4m new to mailing lists, if someone writes an anwer, how can I = reply with his answer after a ">" (like the standard way), or do I have = to edit the message myself and resend it? ------=_NextPart_000_0007_01C2FE98.0448A8F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>trying to compile a simple SDL-Sample = results in=20 this:</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>g++.exe Main.o -o "Template.exe"=20 -L"C:/dev/Dev-Cpp/lib" -L"C:/dev/wx/lib" -L"C:/dev/wx/contrib/lib"=20 -L"C:/dev/SDL/lib" SDL.lib SDLmain.lib</FONT></DIV> <DIV><FONT face=3DArial size=3D2>g++.exe: SDL.lib: No such file or=20 directory<BR>g++.exe: SDLmain.lib: No such file or = directory</FONT></DIV> <DIV><FONT face=3DArial size=3D2>make.exe: *** [Template.exe] Error = 1</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>However, SDL.lib and SDLmain.lib are = present in=20 C:\dev\SDL\lib, which is also entered in the compiler = options.</FONT></DIV> <DIV><FONT face=3DArial size=3D2>This occurs with all libs, also = wxWindows and other=20 toolkits.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Can somebody help me??</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>PS: I=B4m new to mailing lists, if = someone writes an=20 anwer, how can I reply with his answer after a ">" (like the standard = way),=20 or do I have to edit the message myself and resend=20 it?</FONT></DIV></BODY></HTML> ------=_NextPart_000_0007_01C2FE98.0448A8F0-- --__--__-- Message: 8 From: "Ioannis Vranos" <iv...@at...> To: "Dev-C++ Mailing List" <dev...@li...> Subject: RE: [Dev-C++] passing the content of a string to a variable from Date: Wed, 9 Apr 2003 14:04:02 +0300 > -----Original Message----- > From: Per Westermark [mailto:pw...@ia...] > Sent: Wednesday, April 09, 2003 10:02 AM > To: Ioannis Vranos > Cc: Dev-C++ Mailing List > Subject: RE: [Dev-C++] passing the content of a string to a > variable from > > > See below. > > /Per W > > On Wed, 9 Apr 2003, Ioannis Vranos wrote: > > > > -----Original Message----- > > > From: dev...@li... > > > [mailto:dev...@li...] On Behalf > > > Of jose isaias cabrera > > > Sent: Wednesday, April 09, 2003 4:52 AM > > > To: dev...@li... > > > Subject: [Dev-C++] passing the content of a string to a > variable from > > > > > > > > > > > > Greetings O SmartOnes! > > > > > > I have the following c code: > > > > > > char FileContent(char *file) > > // Need to return a pointer to text, not just a single character. > char* FileContent(char *file) Just for accuracy, Ioannis Vranos had not written the above. > > > > { > > > char fcontent(3000); > > // Array size should be in [] > // You may never return address of a variable declared on stack. > // As soon as the FileContent() returns, the fcontent buffer would > // be deleted unless it's declared static, which will store > // fcontent as a global variable but only available within name > // space of FileContent(). > static char fcontent[3000]; The same apply for your comments here. :) Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org --__--__-- Message: 9 Date: Wed, 09 Apr 2003 09:27:31 -0400 To: "jose isaias cabrera" <ji...@fr...>, <dev...@li...> From: David Matthews <dem...@uw...> Subject: Re: [Dev-C++] passing the content of a string to a variable from Looks like what you actually want is something like this: char *FileContent(file *fp) { char *buf; // Open the file... int i =3D fseek(fp, SEEK_END) + 1; buf =3D malloc(sizeof(i)); fseek(fp, SEEK_SET); for(char ch =3D fgetc(fp); ch !=3D EOF; buf++ =3D ch); return buf; } I think this should work at least. The code is off the top of my head and untested. At 09:51 PM 08/04/2003 -0400, jose isaias cabrera wrote: > >Greetings O SmartOnes! > >I have the following c code: > >char FileContent(char *file) >{ > char fcontent(3000); > ... > /*in here I grab the content of a text file */ > ... > return(fcontent); >} > >int main(int argc, char *argv[]) >{ > char text[3000]; > ... > ... > ... > text =3D FileContent("temp.txt"); >} > >I can't get this to work. I've a bunch of places and I even tried to get >the pointers to no avail. I am new to c, but I am an expert programmer. >Any c help will be greatly appreciated. > >thanks. > >jos=E9 > > > > >------------------------------------------------------- >This SF.net email is sponsored by: ValueWeb:=20 >Dedicated Hosting for just $79/mo with 500 GB of bandwidth!=20 >No other company gives more support or power for your dedicated server >http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > --__--__-- Message: 10 Date: Wed, 9 Apr 2003 17:05:25 +0200 (CEST) From: Per Westermark <pw...@ia...> To: David Matthews <dem...@uw...> cc: jose isaias cabrera <ji...@fr...>, <dev...@li...> Subject: Re: [Dev-C++] passing the content of a string to a variable from See below: /Per W On Wed, 9 Apr 2003, David Matthews wrote: > Looks like what you actually want is something like this: > > char *FileContent(file *fp) > { > char *buf; > // Open the file... > int i =3D fseek(fp, SEEK_END) + 1; // Note - will return incorrect size for IS with end-of-line translation. // cr+lf -> lf. However, not too big a problem unless large file with lot // of short lines. i =3D fseek(fp,0,SEEK_END)+1; > buf =3D malloc(sizeof(i)); > fseek(fp, SEEK_SET); fseek(fp,0,SEEK_SET); > for(char ch =3D fgetc(fp); ch !=3D EOF; buf++ =3D ch); // No use to do fgetc() in pre-loop part, since then only one // character will be read, followed by a wild loop. // Also, need *buf++ for post-assign. for (char ch; (ch =3D fgetc(fp)) !=3D EOF; *buf++ =3D ch); // Have to zero-terminate since calloc() wasn't used. *buf =3D '\0''; // One alternative that is a bit quicker: size_t count =3D fread(buf,1,i-1,fp); if (count =3D=3D i) buf[count] =3D '\0'; else buf[0] =3D '\0'; > return buf; > } > > I think this should work at least. The code is off the top of my head an= d > untested. > > At 09:51 PM 08/04/2003 -0400, jose isaias cabrera wrote: > > > >Greetings O SmartOnes! > > > >I have the following c code: > > > >char FileContent(char *file) > >{ > > char fcontent(3000); > > ... > > /*in here I grab the content of a text file */ > > ... > > return(fcontent); > >} > > > >int main(int argc, char *argv[]) > >{ > > char text[3000]; > > ... > > ... > > ... > > text =3D FileContent("temp.txt"); > >} > > > >I can't get this to work. I've a bunch of places and I even tried to ge= t > >the pointers to no avail. I am new to c, but I am an expert programmer. > >Any c help will be greatly appreciated. > > > >thanks. > > > >jos=E9 > > > > > > > > > >------------------------------------------------------- > >This SF.net email is sponsored by: ValueWeb: > >Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > >No other company gives more support or power for your dedicated server > >http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > >_______________________________________________ > >Dev-cpp-users mailing list > >Dev...@li... > >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of TotalView, The debugg= er > for complex code. Debugging C/C++ programs can leave you feeling lost and > disoriented. TotalView can help you find your way. Available on major UNI= X > and Linux platforms. Try it free. www.etnus.com > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > --__--__-- _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users End of Dev-cpp-users Digest |
|
From: lamont <lam...@ve...> - 2003-04-10 03:21:21
|
>Looks like what you actually want is something like this:
>char *FileContent(file *fp)
>{
> char *buf;
> // Open the file...
> int i =3D fseek(fp, SEEK_END) + 1;
> buf =3D malloc(sizeof(i));
> fseek(fp, SEEK_SET);
> for(char ch =3D fgetc(fp); ch !=3D EOF; buf++ =3D ch);
> return buf;
>}
What does the '=3D' do in the above function??
|
|
From: jose i. c. <ji...@fr...> - 2003-04-10 01:29:57
|
Yep. I had the other stuff, but was missing the char *FileContent....
thanks,
jose
----- Original Message -----
From: "David Matthews" <dem...@uw...>
To: "jose isaias cabrera" <ji...@fr...>;
<dev...@li...>
Sent: Wednesday, April 09, 2003 9:27 AM
Subject: Re: [Dev-C++] passing the content of a string to a variable from
Looks like what you actually want is something like this:
char *FileContent(file *fp)
{
char *buf;
// Open the file...
int i = fseek(fp, SEEK_END) + 1;
buf = malloc(sizeof(i));
fseek(fp, SEEK_SET);
for(char ch = fgetc(fp); ch != EOF; buf++ = ch);
return buf;
}
I think this should work at least. The code is off the top of my head and
untested.
At 09:51 PM 08/04/2003 -0400, jose isaias cabrera wrote:
>
>Greetings O SmartOnes!
>
>I have the following c code:
>
>char FileContent(char *file)
>{
> char fcontent(3000);
> ...
> /*in here I grab the content of a text file */
> ...
> return(fcontent);
>}
>
>int main(int argc, char *argv[])
>{
> char text[3000];
> ...
> ...
> ...
> text = FileContent("temp.txt");
>}
>
>I can't get this to work. I've a bunch of places and I even tried to get
>the pointers to no avail. I am new to c, but I am an expert programmer.
>Any c help will be greatly appreciated.
>
>thanks.
>
>josé
>
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: ValueWeb:
>Dedicated Hosting for just $79/mo with 500 GB of bandwidth!
>No other company gives more support or power for your dedicated server
>http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: jose i. c. <ji...@fr...> - 2003-04-10 01:21:00
|
Per, > // Need to return a pointer to text, not just a single character. > char* FileContent(char *file) this worked! Thanks! I had the code correct, but I was returning a string instead of a string pointer. thanks, jose |
|
From: Ioannis V. <iv...@at...> - 2003-04-09 20:08:18
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Samuel Keding > Sent: Wednesday, April 09, 2003 7:46 PM > To: dev...@li... > Subject: [Dev-C++] Re: Conio AND a question > > > To the person that was trying to use some borland functions > in the conio.h file. I had the same problem until somebody > told me to #include <conio.c> which worked for me. > > And now my question: > > I have toyed with borland C++ 5.5, the free downloadable > version. It reported a bunch of syntax errors for a source > file that compiled fine under dev C++ using the minGW > compiler. Some of the syntax errors appeared to be centered > on the fact that I had a constructor in a structure. > According to ANSI C++, can a structure have a constructor? > Did they allow structures to have constructor's in older standards? Yes structs can have a constructor (I assume you do not have it in private access, and it is a .cpp file). There are not older standards for C++. The first is the last one, the ANSI/ISO C++ 14882:1998 standard (there is/will be an intermediate revision this year, which is "bug fixes"). Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: David M. <dem...@uw...> - 2003-04-09 17:00:20
|
Gahh, stupid stupid.
At 09:27 AM 09/04/2003 -0400, David Matthews wrote:
>Looks like what you actually want is something like this:
>
>char *FileContent(file *fp)
>{
> char *buf;
> // Open the file...
> int i =3D fseek(fp, SEEK_END) + 1;
> buf =3D malloc(sizeof(i));
Should be malloc(i); instead :\
> fseek(fp, SEEK_SET);
> for(char ch =3D fgetc(fp); ch !=3D EOF; buf++ =3D ch);
> return buf;
>}
>
>I think this should work at least. The code is off the top of my head and
>untested.
>
>At 09:51 PM 08/04/2003 -0400, jose isaias cabrera wrote:
>>
>>Greetings O SmartOnes!
>>
>>I have the following c code:
>>
>>char FileContent(char *file)
>>{
>> char fcontent(3000);
>> ...
>> /*in here I grab the content of a text file */
>> ...
>> return(fcontent);
>>}
>>
>>int main(int argc, char *argv[])
>>{
>> char text[3000];
>> ...
>> ...
>> ...
>> text =3D FileContent("temp.txt");
>>}
>>
>>I can't get this to work. I've a bunch of places and I even tried to get
>>the pointers to no avail. I am new to c, but I am an expert programmer.
>>Any c help will be greatly appreciated.
>>
>>thanks.
>>
>>jos=E9
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF.net email is sponsored by: ValueWeb:=20
>>Dedicated Hosting for just $79/mo with 500 GB of bandwidth!=20
>>No other company gives more support or power for your dedicated server
>>http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
>>_______________________________________________
>>Dev-cpp-users mailing list
>>Dev...@li...
>>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger=
=20
>for complex code. Debugging C/C++ programs can leave you feeling lost and=
=20
>disoriented. TotalView can help you find your way. Available on major UNIX=
=20
>and Linux platforms. Try it free. www.etnus.com
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Per W. <pw...@ia...> - 2003-04-09 16:53:11
|
A struct and a class is just about the same. The main difference is that a struct has default public access, while a class requires you to write protected: or public: if you want to access the contents. /Per W On Wed, 9 Apr 2003, Samuel Keding wrote: > To the person that was trying to use some borland functions in the conio.h file. I had the same problem until somebody told me to #include <conio.c> which worked for me. > > And now my question: > > I have toyed with borland C++ 5.5, the free downloadable version. It reported a bunch of syntax errors for a source file that compiled fine under dev C++ using the minGW compiler. Some of the syntax errors appeared to be centered on the fact that I had a constructor in a structure. According to ANSI C++, can a structure have a constructor? Did they allow structures to have constructor's in older standards? > > > ____________________________________________________________ > Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year. > http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger > for complex code. Debugging C/C++ programs can leave you feeling lost and > disoriented. TotalView can help you find your way. Available on major UNIX > and Linux platforms. Try it free. www.etnus.com > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Samuel K. <ib...@ly...> - 2003-04-09 16:46:27
|
To the person that was trying to use some borland functions in the conio.h file. I had the same problem until somebody told me to #include <conio.c> which worked for me. And now my question: I have toyed with borland C++ 5.5, the free downloadable version. It reported a bunch of syntax errors for a source file that compiled fine under dev C++ using the minGW compiler. Some of the syntax errors appeared to be centered on the fact that I had a constructor in a structure. According to ANSI C++, can a structure have a constructor? Did they allow structures to have constructor's in older standards? ____________________________________________________________ Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year. http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus |
|
From: Per W. <pw...@ia...> - 2003-04-09 15:06:52
|
See below:
/Per W
On Wed, 9 Apr 2003, David Matthews wrote:
> Looks like what you actually want is something like this:
>
> char *FileContent(file *fp)
> {
> char *buf;
> // Open the file...
> int i =3D fseek(fp, SEEK_END) + 1;
// Note - will return incorrect size for IS with end-of-line translation.
// cr+lf -> lf. However, not too big a problem unless large file with lot
// of short lines.
i =3D fseek(fp,0,SEEK_END)+1;
> buf =3D malloc(sizeof(i));
> fseek(fp, SEEK_SET);
fseek(fp,0,SEEK_SET);
> for(char ch =3D fgetc(fp); ch !=3D EOF; buf++ =3D ch);
// No use to do fgetc() in pre-loop part, since then only one
// character will be read, followed by a wild loop.
// Also, need *buf++ for post-assign.
for (char ch; (ch =3D fgetc(fp)) !=3D EOF; *buf++ =3D ch);
// Have to zero-terminate since calloc() wasn't used.
*buf =3D '\0'';
// One alternative that is a bit quicker:
size_t count =3D fread(buf,1,i-1,fp);
if (count =3D=3D i)
buf[count] =3D '\0';
else
buf[0] =3D '\0';
> return buf;
> }
>
> I think this should work at least. The code is off the top of my head an=
d
> untested.
>
> At 09:51 PM 08/04/2003 -0400, jose isaias cabrera wrote:
> >
> >Greetings O SmartOnes!
> >
> >I have the following c code:
> >
> >char FileContent(char *file)
> >{
> > char fcontent(3000);
> > ...
> > /*in here I grab the content of a text file */
> > ...
> > return(fcontent);
> >}
> >
> >int main(int argc, char *argv[])
> >{
> > char text[3000];
> > ...
> > ...
> > ...
> > text =3D FileContent("temp.txt");
> >}
> >
> >I can't get this to work. I've a bunch of places and I even tried to ge=
t
> >the pointers to no avail. I am new to c, but I am an expert programmer.
> >Any c help will be greatly appreciated.
> >
> >thanks.
> >
> >jos=E9
> >
> >
> >
> >
> >-------------------------------------------------------
> >This SF.net email is sponsored by: ValueWeb:
> >Dedicated Hosting for just $79/mo with 500 GB of bandwidth!
> >No other company gives more support or power for your dedicated server
> >http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
> >_______________________________________________
> >Dev-cpp-users mailing list
> >Dev...@li...
> >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of TotalView, The debugg=
er
> for complex code. Debugging C/C++ programs can leave you feeling lost and
> disoriented. TotalView can help you find your way. Available on major UNI=
X
> and Linux platforms. Try it free. www.etnus.com
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: David M. <dem...@uw...> - 2003-04-09 14:40:57
|
Looks like what you actually want is something like this:
char *FileContent(file *fp)
{
char *buf;
// Open the file...
int i =3D fseek(fp, SEEK_END) + 1;
buf =3D malloc(sizeof(i));
fseek(fp, SEEK_SET);
for(char ch =3D fgetc(fp); ch !=3D EOF; buf++ =3D ch);
return buf;
}
I think this should work at least. The code is off the top of my head and
untested.
At 09:51 PM 08/04/2003 -0400, jose isaias cabrera wrote:
>
>Greetings O SmartOnes!
>
>I have the following c code:
>
>char FileContent(char *file)
>{
> char fcontent(3000);
> ...
> /*in here I grab the content of a text file */
> ...
> return(fcontent);
>}
>
>int main(int argc, char *argv[])
>{
> char text[3000];
> ...
> ...
> ...
> text =3D FileContent("temp.txt");
>}
>
>I can't get this to work. I've a bunch of places and I even tried to get
>the pointers to no avail. I am new to c, but I am an expert programmer.
>Any c help will be greatly appreciated.
>
>thanks.
>
>jos=E9
>
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: ValueWeb:=20
>Dedicated Hosting for just $79/mo with 500 GB of bandwidth!=20
>No other company gives more support or power for your dedicated server
>http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|