dev-cpp-users Mailing List for Dev-C++ (Page 167)
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: Pascal <p.t...@ti...> - 2004-11-21 07:01:57
|
Hello, Where find the help file win32api.hlp and devcpp.hlp in french language please or how decompile for translate? |
|
From: Per W. <pw...@ia...> - 2004-11-20 11:36:37
|
First of all - i don't like a construct: if (strcat(x,y()) == NULL) ... since that implies that x is NULL - strcat doesn't perform any reallocations, it just returns the address of it's first parameter! You should have checked up on x long before, i.e. when you allocated x. Unless you are using a nice and current C++ compiler, in which case the new operator don't return a NULL. Second: Why bother with a list/queue/vector/... of lines. All you need is the current and previous lines in memory. Why? If you previous line ends with a // comment and your current line starts with white space followed by //, that is enough to activate conversion mode. Emit previous line but with the comment using "/*". Then just pricess lines until you find a line that doesn't start with white space followed by "//". Emit previous line but with an ending "*/". This state-machine concept allows you to handle a 10-million-line comment without requiring any extra memory. All you need is memory enough for two arbitrary long lines. /Per W On 19 Nov 2004, Curious Student wrote: > I am writing a program that will take a string that has a C source file and it would format all the multi-line comments like these: > > > //Jingle bells, jingle bells, jingles all the way > //O what fun it is to ride in a one-horse open sledge > //yeah, jingle bells.... > > > into > > > /*Jingle bells, jingle bells, jingles all the way > O what fun it is to ride in a one-horse open sledge > yeah, jingle bells....*/ > > > or the lines, > > > i=0; //Isn't it nice > //today? hehehehe.... > > > into > > > i=0; /*Isn't it nice > today? hehehehe...*/ > > > The code can be downloaded from here. > > http://www.vbforums.com/attachment.php?s=&postid=1841801 > > I've finished coding it but I'm still not through debugging it. > > I've taken a linked list to represent a single comment block that needs to be formatted. Each node would represent one line of source code that contains a comment. The list is represented by a struct LOC that looks like this: > > > /*Represent a line of code that has a // comment in it > The purpose of this structure is to store those lines of > source code that: > > (1) Contain a // in them > (2) Appear in a series > (3) Are a part of one multi-line comment that is to be formatted > > For more information, please read the "Comments to be targetted" section > in the specification file "Read Me.txt" in this project > */ > struct LOC > { > char *Text; //Text of the line containing the comment > > struct LOC *NextLine; //Pointer to the next comment > > int Len; //length of the line containing the comment > > int Position; //Starting position of the comment in the line of text > > int WasFirstNonSpaceChar; /*A boolean value indicating if the comment > was the first non-space character in the line > of text*/ > }; > > > I'm facing a problem in my FormatBlock function. Particularly in this while loop within the FormatBlock function. > > > > while(head!=NULL) > { > if(strcat(NewBlock, Replace(head->Text, head->Position, head->Position+1, " "))==NULL) > return NULL; > > if(head->NextLine==NULL) > strcat(NewBlock, "*/"); > else > strcat(NewBlock, sNewLine); > head=head->NextLine; > } > > > > What happens is that in this while loop, somehow, while i'm only traversing the loop and replacing, say, node 3 out of 5 nodes in my linked list, the text of the 5th node in the list gets changed somehow. Just before this loop, all the elements are intact. I put printf statements at many steps and discovered that the problem is only when it comes to the 2nd element of the linked list within this loop that it changes the 5th element. > > For a test, I am currently reading the comments from a file that I created called "Code.c" and put in C:. > > You will find the file Code.c also within the attachment linked above. Please download it and put the Code.c file in C: and then walk through the code. > > > Thoughts as to what might be causing this problem? > > > > PS: I know there's a memory leak here in this line. > > if(strcat(NewBlock, Replace(head->Text, head->Position, head->Position+1, " "))==NULL) > > This is just rough work. I have a day job, and I wrote that code in a hurry. I will remove all leaks. Also the naming convention sucks because I haven't found a convention to stick to, that is to my taste. I still have to land on one. No typedef used instead of struct LOC* all the time. |
|
From: Curious S. <est...@re...> - 2004-11-19 23:56:31
|
I am writing a program that will take a string that has a C source file and= it would format all the multi-line comments like these:=0A=0A=0A//Jingle b= ells, jingle bells, jingles all the way=0A//O what fun it is to ride in a o= ne-horse open sledge=0A//yeah, jingle bells....=0A=0A=0Ainto=0A=0A=0A/*Jing= le bells, jingle bells, jingles all the way=0AO what fun it is to ride in a= one-horse open sledge=0Ayeah, jingle bells....*/=0A=0A=0Aor the lines,=0A= =0A=0Ai=3D0; //Isn't it nice=0A//today? hehehehe....=0A=0A=0Ainto=0A=0A=0Ai= =3D0; /*Isn't it nice=0Atoday? hehehehe...*/=0A=0A=0AThe code can be downlo= aded from here. =0A=0Ahttp://www.vbforums.com/attachment.php?s=3D&postid=3D= 1841801=0A=0AI've finished coding it but I'm still not through debugging it= .=0A=0AI've taken a linked list to represent a single comment block that ne= eds to be formatted. Each node would represent one line of source code that= contains a comment. The list is represented by a struct LOC that looks li= ke this:=0A=0A=0A/*Represent a line of code that has a // comment in it=0AT= he purpose of this structure is to store those lines of=0Asource code that:= =0A=0A (1) Contain a // in them=0A (2) Appear in a series=0A (3) Are a p= art of one multi-line comment that is to be formatted=0A=0A For more infor= mation, please read the "Comments to be targetted" section=0A in the speci= fication file "Read Me.txt" in this project=0A*/=0Astruct LOC=0A{=0A cha= r *Text; //Text of the line containing the comment=0A=0A struct LOC *Nex= tLine; //Pointer to the next comment=0A=0A int Len; //length of the line= containing the comment=0A=0A int Position; //Starting position of the c= omment in the line of text=0A=0A int WasFirstNonSpaceChar; /*A boolean v= alue indicating if the comment =0A was the fir= st non-space character in the line =0A of text= */=0A};=0A=0A=0AI'm facing a problem in my FormatBlock function. Particular= ly in this while loop within the FormatBlock function.=0A=0A=0A=0Awhile(hea= d!=3DNULL)=0A {=0A if(strcat(NewBlock, Replace(head->Text, head->= Position, head->Position+1, " "))=3D=3DNULL)=0A return NULL;=0A= =0A if(head->NextLine=3D=3DNULL)=0A strcat(NewBlo= ck, "*/");=0A else=0A strcat(NewBlock, sNewLine);=0A = head=3Dhead->NextLine;=0A }=0A=0A=0A=0AWhat happens is that in this w= hile loop, somehow, while i'm only traversing the loop and replacing, say, = node 3 out of 5 nodes in my linked list, the text of the 5th node in the li= st gets changed somehow. Just before this loop, all the elements are intact= . I put printf statements at many steps and discovered that the problem is = only when it comes to the 2nd element of the linked list within this loop t= hat it changes the 5th element.=0A=0AFor a test, I am currently reading the= comments from a file that I created called "Code.c" and put in C:.=0A=0AYo= u will find the file Code.c also within the attachment linked above. Please= download it and put the Code.c file in C: and then walk through the code.= =0A=0A=0AThoughts as to what might be causing this problem? =0A=0A=0A=0APS:= I know there's a memory leak here in this line.=0A=0Aif(strcat(NewBlock, R= eplace(head->Text, head->Position, head->Position+1, " "))=3D=3DNULL)=0A= =0AThis is just rough work. I have a day job, and I wrote that code in a hu= rry. I will remove all leaks. Also the naming convention sucks because I ha= ven't found a convention to stick to, that is to my taste. I still have to = land on one. No typedef used instead of struct LOC* all the time.=20 |
|
From: Guillermo G. <ggu...@ma...> - 2004-11-19 18:09:08
|
Hello, I was wondering, how do I go about getting a command prompt to appear in = the background with my GUI application. If I compile and the flu_combo_box.cpp example I see the GUI app with a = console to display the output of the printf() commands. I have tried removing the -DWIN32 compiler parameter, setting it as a = win32 console app (which wouldn't let it compile btw). what can I do, is there some sort of debug option for dev-cpp-4990 with = GCC-3.3.3. I am on a win2k machine. Guillermo Gutierrez Market Scan Information Systems Software Q.A. Supervisor (818) 575-2000 x2427 ggu...@ma... _______________________________________________ fltk mailing list fl...@ea... http://lists.easysw.com/mailman/listinfo/fltk |
|
From: youngs <you...@ut...> - 2004-11-19 08:04:03
|
------------------------- Best Regards Youngs |
|
From: Adrien R. <rab...@fr...> - 2004-11-18 14:54:12
|
Oh yes, I'm stupid, I should have read the f... manual !! It was right-click on the "Class" tab, and the "New class" subitem in the contextual menu. I'm new to DevC++ and I expected to find this feature in the main menu bar. Sorry. Best regards, A.R. ----- Original Message ----- From: "Thomas Witt" <wi...@we...> To: "Adrien REBOISSON" <rab...@fr...> Cc: <dev...@li...> Sent: Thursday, November 18, 2004 10:37 AM Subject: Re: [Dev-C++] Search for a kind of "Class Builder" > Adrien REBOISSON wrote: >> Hi all, >> >> First sorry for my bad English, I'm french. > First sorry for my bad English, I'm German. > >> I discovered Dev-C++ and I wonder if it exists a kind of "class builder" >> which can help me to create HPP/CPP files quickly. > > I am pretty shure that the Dev-C++ class anager includes that feature. I > can't check this at the moment but it might be some right-click option > inside the class browser. > > -=#=- > mfg, Thomas > > |
|
From: Szczepan H. <ru...@wp...> - 2004-11-18 13:28:54
|
> I discovered Dev-C++ and I wonder if it exists a kind of "class builder" > which can help me to create HPP/CPP files quickly. Try Jimmy Venema's ClassBuilder! It is pretty usable at 2.4. The development has been stalled for several months but the author says it is a temporary situation. http://members.lycos.nl/JimmyVenema/ClassBuilder/ClassBuilder.htm Szczepan Holyszewski |
|
From: Paul I. <pi...@ot...> - 2004-11-18 11:30:35
|
Hazael Serrano wrote: >I need to make a program using the parallel port but I don't know what is the function to handle the parallel port and in which library is it, could anyone help me > >Hazael Serrano > > > >------------------------------------------------------- >This SF.Net email is sponsored by: InterSystems CACHE >FREE OODBMS DOWNLOAD - A multidimensional database that combines >robust object and relational technologies, making it a perfect match >for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > Use CreateFile to open "\\lpt1\" , unless you need full control of the pins. HTH |
|
From: Thomas W. <wi...@we...> - 2004-11-18 08:58:09
|
Adrien REBOISSON wrote: > Hi all, > > First sorry for my bad English, I'm french. First sorry for my bad English, I'm German. > I discovered Dev-C++ and I wonder if it exists a kind of "class builder" > which can help me to create HPP/CPP files quickly. I am pretty shure that the Dev-C++ class anager includes that feature. I can't check this at the moment but it might be some right-click option inside the class browser. -=#=- mfg, Thomas |
|
From: Alf C S. <al...@st...> - 2004-11-18 06:42:45
|
I have developed a program on Linux and carried the source to Windows and while attempting to compile get an error message saying that one cannot use the -o with -c options. I am sure that this was covered previously but I cannot find it. --- Regards, Alf Stockton www.stockton.co.za Lie, n.: A very poor substitute for the truth, but the only one discovered to date. |
|
From: Jay B. <jay...@ni...> - 2004-11-17 19:55:05
|
[snip] I need to make a program using the parallel port but I don't know what is the function to handle the parallel port and in which library is it, could anyone help me [/snip] http://www.google.com/search?hl=3Den&q=3DC+library+to+handle+parallel+por= ts |
|
From: Hazael S. <Hse...@lo...> - 2004-11-17 19:49:16
|
I need to make a program using the parallel port but I don't know what = is the function to handle the parallel port and in which library is it, = could anyone help me Hazael Serrano |
|
From: augustowebd <aug...@gm...> - 2004-11-17 19:13:45
|
--=20 A diferen=E7a entre os homens comuns e os guerreiros =E9 que os guerreiros encaram tudo como um desafio, enquanto os homens comuns encaram tudo como uma ben=E7=E3o ou uma maldi=E7=E3o. |
|
From: Adrien R. <rab...@fr...> - 2004-11-16 17:53:57
|
Hi all, First sorry for my bad English, I'm french. I discovered Dev-C++ and I wonder if it exists a kind of "class builder" which can help me to create HPP/CPP files quickly. If not, can I extend the software (by a sort of "plugin", I mean) to include a such tool created by myself (I'm used to develop with Delphi) ? How ? Thank you ! A.R. |
|
From: Zachary U. <ne...@gm...> - 2004-11-16 09:11:45
|
Hi, I installed Dev-C++ 4.9.9.0 (full version) in Windows 98, SE and when I use the WebUpdate Module it never installs the update. For example: I selected mirror "PlanetMirror.com" next checked box for "Dev-C++ Update" and click "Download Selected" it downloads the file and the status changes to "disconncted" then nothing happens! i watched the download progress meter so it seemed to complete then the app just freezes, even if i click on "close" nothing happens but if i do Ctrl-Alt-Del I see the process and it doesn't say "Not responding" or anything , and as soon as I cancel the Ctrl-Alt-Del a dialog box pops up in Dev-C++ saying "The updates you selected have been downloaded. They will now be installed" so i click "OK" and nothing happens :( if i close Dev-C++ and repeat the whole process i get same result i recall using older version 1 year ago also in Windows 98 SE and never had this problem. help please :) zach |
|
From: Per W. <pw...@ia...> - 2004-11-13 18:51:27
|
Hey folks. I hear that xx has many flaws. Can anyone recommend an alternative xx program? Joke aside. Given the large number of applications developed using gdb, I don't think you need to think of it as inadequate. Instead, just locate a nice graphical front end for it. It definitely works. I usually run gdb with gvd - The GNU Visual Debugger, but there are several other good front ends available. /Per W On Sat, 13 Nov 2004, Rob Lawless wrote: > hey folks I hear that the GDB debugger has many flaws > can anyone recommend an alternative (good) c++ debugger? > regards > Rob |
|
From: Rob L. <rob...@nt...> - 2004-11-13 18:38:49
|
hey folks I hear that the GDB debugger has many flaws can anyone recommend an alternative (good) c++ debugger? regards Rob |
|
From: Keith H. <kha...@ya...> - 2004-11-13 12:29:50
|
kha...@ya... ___________________________________________________________ Win a castle for NYE with your mates and Yahoo! Messenger http://uk.messenger.yahoo.com |
|
From: Per W. <pw...@ia...> - 2004-11-13 03:51:05
|
Anything happening in and around the processor is so fast that the processor itself can't process the signals and emit them. That is the reason people buy _expensive_ logic analyzers if they want to look at computer hardware signals. The only kind of signals you can produce is sound-frequency signals, where the processor (or DSP of the sound card) may produce wave forms and then emit them on the analog or digital output of the sound card. The best cards support output up to 192k samples/second. /Per W On 13 Nov 2004, MD T wrote: > Hi All, > Good day, > I would like to know if anyone has written any programs to generate > signal waves of different parameters from 1cps to geig acps. Pulses and squarewaves. At least is there a program to access the CPU's signals and amplify it and put out through ports? For example my CPU is Athlon 2000+ which has 1.666GHz. Can I take it out, amplify, divide/multiply. change duty ratio,modulate to pulse code modulation, etc........? > ATB, > MD T. |
|
From: MD T <md...@re...> - 2004-11-13 03:22:11
|
Hi All,=0A Good day, =0AI would like to know if anyone has written = any programs to generate=0Asignal waves of different parameters from 1cps t= o geig acps. Pulses and squarewaves. At least is there a program to access = the CPU's signals and amplify it and put out through ports? For example my = CPU is Athlon 2000+ which has 1.666GHz. Can I take it out, amplify, divide/= multiply. change duty ratio,modulate to pulse code modulation, etc........?= =0AATB,=0AMD T. |
|
From: MD T <md...@re...> - 2004-11-13 03:07:03
|
=A0=0A=0A=0AHi All,=0A I am glad that my random number program is wo= rking now in DEV C++ compiler and I am thankful to the DEV C++ authors or p= roviders for their free gift of this compiler. The mistake I was doing was = setting the default to C and writing the C++ program. When I changed this s= etting it gave the perfect output except to the part that " PRESS ANY KEY t= o continue .....". =0ANow I am trying to get the numbers in one go, Any sug= gestions there, Friends?=0AAnd I want to put this program into my mobile ph= one and run it.I don't know how, Any suppot here, Friends?=0ABest regards,= =0AMD T=20 |
|
From: Daniel K. O. <dan...@ya...> - 2004-11-13 00:00:38
|
Den...@ao... wrote: > strncpy(FirstMix,FirstName,3); (...) > has anybody an idea as to where the extra characters are coming from???? They are garbage of uninitialized memory. If you read the documentation for strncpy() you'll see that it copies 3 characters when you call it. None of your 3 characters are the '\0' terminator, because the '\0' it's beyond the 3 chars you are copying (it's the 5th char in "JACK", and 9th in "ROBINSON"). So you get a non-terminated string. When using strncpy() you have always to terminate it by hand. Daniel K. O. |
|
From: <wa...@wa...> - 2004-11-12 23:57:02
|
On 12 Nov 2004 at 18:41, Den...@ao... wrote:
> Please enter the name JACK
> JACK
> Now please enter the name ROBINSON
> ROBINSON
> FirstMix=JAC?-?@
> FirstMix=JAC?-?@ROB
>
> has anybody an idea as to where the extra characters are coming
> from???? thanks in advance.
strncpy does not append a NULL if there isn't a NULL in what it's
copying. So... FirstMix wasn't set to all nulls when it was
initialized and when you copied the first three characters into it,
there was no null to signal the end of the string. You can't assume
that an array of chars will be initialized to null. Sometimes it
will be and sometimes it won't.
You can fix that by either initializing the string to all nulls or by
inserting the null after the strncpy. For example, check out these
modifications to your code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define SIZE_OF 15
int main()
{
char FirstName[SIZE_OF], SecondName[SIZE_OF],
FirstMix[SIZE_OF],SecondMix[SIZE_OF];
// used SIZE_OF instead of declaring each array size individualy
strcpy(FirstMix, "123456789");
printf("Please enter the name JACK\n");
scanf("%s", &FirstName);
printf("Now please enter the name ROBINSON\n");
scanf("%s", &SecondName);
strncpy(FirstMix,FirstName,3);
printf("FirstMix=%s\n", FirstMix);
strncat(FirstMix,SecondName,3);
printf("FirstMix=%s\n", FirstMix);
strcpy(FirstMix, "123456789");
strncpy(FirstMix, FirstName, 3);
FirstMix[3] = '\0';
printf("FirstMix=%s\n", FirstMix);
strncat(FirstMix,SecondName,3);
printf("FirstMix=%s\n", FirstMix);
system("pause");
return 0 ;
}
And here's the output:
Please enter the name JACK
JACK
Now please enter the name ROBINSON
ROBINSON
FirstMix=JAC456789
FirstMix=JAC456789ROB
FirstMix=JAC
FirstMix=JACROB
Press any key to continue . . .
HTH.
Watson (the pencil neck) Davis
|
|
From: <Den...@ao...> - 2004-11-12 23:42:09
|
Hi there,
im having problems on a small program that I'm using for a course to display
the properties of strncpy.
The trouble is having compiled the code I keep getting a strange output,
my code is
#include <stdio.h>
#include <string.h>
#define SIZE_OF 15
int main()
{
char FirstName[SIZE_OF], SecondName[SIZE_OF],
FirstMix[SIZE_OF],SecondMix[SIZE_OF];
// used SIZE_OF instead of declaring each array size individualy
printf("Please enter the name JACK\n");
scanf("%s", &FirstName);
printf("Now please enter the name ROBINSON\n");
scanf("%s", &SecondName);
strncpy(FirstMix,FirstName,3);
printf("FirstMix=%s\n", FirstMix);
strncat(FirstMix,SecondName,3);
printf("FirstMix=%s\n", FirstMix);
return 0 ;
}
and my output is
Please enter the name JACK
JACK
Now please enter the name ROBINSON
ROBINSON
FirstMix=JAC?-?@
FirstMix=JAC?-?@ROB
has anybody an idea as to where the extra characters are coming from????
thanks in advance.
|
|
From: <ms...@wp...> - 2004-11-12 18:02:00
|
Dnia 2004-11-12 17:26, Użytkownik Per Westermark napisał:
(...)
> #include <sstream>
> std::ostringstream s;
> s << my_int << " " << my_double;
> std::string str = s.str();
This is (for me) the most in C++ style. For better similar to IntToStr()
from Delphi it can (?) be written as:
#include <sstream>
std::string itos(int i)
{
std::stringstream s;
s << i;
return s.str();
}
(Example found via google).
Regards
Marcin
|