Wed Dec 4 00:40:27 2024
EVENTS
 FREE
SOFTWARE
INSTITUTE

POLITICS
JOBS
MEMBERS'
CORNER

MAILING
LIST

NYLXS Mailing Lists and Archives
NYLXS Members have a lot to say and share but we don't keep many secrets. Join the Hangout Mailing List and say your peice.

DATE 2005-01-01

HANGOUT

2024-12-04 | 2024-11-04 | 2024-10-04 | 2024-09-04 | 2024-08-04 | 2024-07-04 | 2024-06-04 | 2024-05-04 | 2024-04-04 | 2024-03-04 | 2024-02-04 | 2024-01-04 | 2023-12-04 | 2023-11-04 | 2023-10-04 | 2023-09-04 | 2023-08-04 | 2023-07-04 | 2023-06-04 | 2023-05-04 | 2023-04-04 | 2023-03-04 | 2023-02-04 | 2023-01-04 | 2022-12-04 | 2022-11-04 | 2022-10-04 | 2022-09-04 | 2022-08-04 | 2022-07-04 | 2022-06-04 | 2022-05-04 | 2022-04-04 | 2022-03-04 | 2022-02-04 | 2022-01-04 | 2021-12-04 | 2021-11-04 | 2021-10-04 | 2021-09-04 | 2021-08-04 | 2021-07-04 | 2021-06-04 | 2021-05-04 | 2021-04-04 | 2021-03-04 | 2021-02-04 | 2021-01-04 | 2020-12-04 | 2020-11-04 | 2020-10-04 | 2020-09-04 | 2020-08-04 | 2020-07-04 | 2020-06-04 | 2020-05-04 | 2020-04-04 | 2020-03-04 | 2020-02-04 | 2020-01-04 | 2019-12-04 | 2019-11-04 | 2019-10-04 | 2019-09-04 | 2019-08-04 | 2019-07-04 | 2019-06-04 | 2019-05-04 | 2019-04-04 | 2019-03-04 | 2019-02-04 | 2019-01-04 | 2018-12-04 | 2018-11-04 | 2018-10-04 | 2018-09-04 | 2018-08-04 | 2018-07-04 | 2018-06-04 | 2018-05-04 | 2018-04-04 | 2018-03-04 | 2018-02-04 | 2018-01-04 | 2017-12-04 | 2017-11-04 | 2017-10-04 | 2017-09-04 | 2017-08-04 | 2017-07-04 | 2017-06-04 | 2017-05-04 | 2017-04-04 | 2017-03-04 | 2017-02-04 | 2017-01-04 | 2016-12-04 | 2016-11-04 | 2016-10-04 | 2016-09-04 | 2016-08-04 | 2016-07-04 | 2016-06-04 | 2016-05-04 | 2016-04-04 | 2016-03-04 | 2016-02-04 | 2016-01-04 | 2015-12-04 | 2015-11-04 | 2015-10-04 | 2015-09-04 | 2015-08-04 | 2015-07-04 | 2015-06-04 | 2015-05-04 | 2015-04-04 | 2015-03-04 | 2015-02-04 | 2015-01-04 | 2014-12-04 | 2014-11-04 | 2014-10-04 | 2014-09-04 | 2014-08-04 | 2014-07-04 | 2014-06-04 | 2014-05-04 | 2014-04-04 | 2014-03-04 | 2014-02-04 | 2014-01-04 | 2013-12-04 | 2013-11-04 | 2013-10-04 | 2013-09-04 | 2013-08-04 | 2013-07-04 | 2013-06-04 | 2013-05-04 | 2013-04-04 | 2013-03-04 | 2013-02-04 | 2013-01-04 | 2012-12-04 | 2012-11-04 | 2012-10-04 | 2012-09-04 | 2012-08-04 | 2012-07-04 | 2012-06-04 | 2012-05-04 | 2012-04-04 | 2012-03-04 | 2012-02-04 | 2012-01-04 | 2011-12-04 | 2011-11-04 | 2011-10-04 | 2011-09-04 | 2011-08-04 | 2011-07-04 | 2011-06-04 | 2011-05-04 | 2011-04-04 | 2011-03-04 | 2011-02-04 | 2011-01-04 | 2010-12-04 | 2010-11-04 | 2010-10-04 | 2010-09-04 | 2010-08-04 | 2010-07-04 | 2010-06-04 | 2010-05-04 | 2010-04-04 | 2010-03-04 | 2010-02-04 | 2010-01-04 | 2009-12-04 | 2009-11-04 | 2009-10-04 | 2009-09-04 | 2009-08-04 | 2009-07-04 | 2009-06-04 | 2009-05-04 | 2009-04-04 | 2009-03-04 | 2009-02-04 | 2009-01-04 | 2008-12-04 | 2008-11-04 | 2008-10-04 | 2008-09-04 | 2008-08-04 | 2008-07-04 | 2008-06-04 | 2008-05-04 | 2008-04-04 | 2008-03-04 | 2008-02-04 | 2008-01-04 | 2007-12-04 | 2007-11-04 | 2007-10-04 | 2007-09-04 | 2007-08-04 | 2007-07-04 | 2007-06-04 | 2007-05-04 | 2007-04-04 | 2007-03-04 | 2007-02-04 | 2007-01-04 | 2006-12-04 | 2006-11-04 | 2006-10-04 | 2006-09-04 | 2006-08-04 | 2006-07-04 | 2006-06-04 | 2006-05-04 | 2006-04-04 | 2006-03-04 | 2006-02-04 | 2006-01-04 | 2005-12-04 | 2005-11-04 | 2005-10-04 | 2005-09-04 | 2005-08-04 | 2005-07-04 | 2005-06-04 | 2005-05-04 | 2005-04-04 | 2005-03-04 | 2005-02-04 | 2005-01-04 | 2004-12-04 | 2004-11-04 | 2004-10-04 | 2004-09-04 | 2004-08-04 | 2004-07-04 | 2004-06-04 | 2004-05-04 | 2004-04-04 | 2004-03-04 | 2004-02-04 | 2004-01-04 | 2003-12-04 | 2003-11-04 | 2003-10-04 | 2003-09-04 | 2003-08-04 | 2003-07-04 | 2003-06-04 | 2003-05-04 | 2003-04-04 | 2003-03-04 | 2003-02-04 | 2003-01-04 | 2002-12-04 | 2002-11-04 | 2002-10-04 | 2002-09-04 | 2002-08-04 | 2002-07-04 | 2002-06-04 | 2002-05-04 | 2002-04-04 | 2002-03-04 | 2002-02-04 | 2002-01-04 | 2001-12-04 | 2001-11-04 | 2001-10-04 | 2001-09-04 | 2001-08-04 | 2001-07-04 | 2001-06-04 | 2001-05-04 | 2001-04-04 | 2001-03-04 | 2001-02-04 | 2001-01-04 | 2000-12-04 | 2000-11-04 | 2000-10-04 | 2000-09-04 | 2000-08-04 | 2000-07-04 | 2000-06-04 | 2000-05-04 | 2000-04-04 | 2000-03-04 | 2000-02-04 | 2000-01-04 | 1999-12-04

Key: Value:

Key: Value:

MESSAGE
DATE 2005-01-26
FROM Ruben Safir Secretary NYLXS
SUBJECT Re: [hangout] Simple C question

Document pelase because it works just fine


#include
#include

char a[]="Hello Earth";
char b[]="Hello Moon";

int main(int argc, char ** argv){

strncpy(a,b,10);
printf("%s\n",a);
exit;
}

ruben-at-www2:~> ./a.out
Hello Moonh


On Wed, Jan 26, 2005 at 10:52:06PM -0500, Billy wrote:
>
> Ruben Safir wrote:
> >On Tue, 2005-01-25 at 16:03, Billy wrote:
> >
> >>Inker, Evan wrote:
> >>>
> >>>#include
> >>>#include
> >>>
> >>>void strcopy(const char *, char *);
> >>>
> >>>int main() {
> >>> char string1[] = "This is string1";
> >>> char string2[] = "This is string2";
> >>>
> >>> strcopy(string1, string2);
> >>> printf("String2: %s", string2);
> >>>}
> >>>
> >>>void strcopy(const char * str1, char * str2) {
> >>> int x = 0;
> >>>
> >>> /* change the size of string2 to the size of string1 */
> >>> realloc(str2, sizeof(str1));
> >>>
> >>> do {
> >>> str2[x] = str1[x];
> >>> } while (str1[x++] != '\0');
> >>>
> >>>}
> >>
> >>
> >>This program is incorrect.
> >>YOU CANNOT overwrite the contents of string2.
> >
> >
> >
> >Why not? It is not a string literal.
>
> char string2[] = "This is string2";
>
> Yes it is.
>
> >
> >>It is also illegal to
> >>realloc() a pointer which was not obtained by malloc().
> >>also, realloc is free to move the block. you have to use its return
> >>value to update the pointer. There's just so much wrong...
> >>
> >>I DON'T RECOMMEND learning from this example.
> >>
> >
> >
> >I agree. There is no reason to rewrite strncpy
>
>
> ____________________________
> NYLXS: New Yorker Free Software Users Scene
> Fair Use -
> because it's either fair use or useless....
> NYLXS is a trademark of NYLXS, Inc

--
__________________________
Brooklyn Linux Solutions

So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://fairuse.nylxs.com

http://www.mrbrklyn.com - Consulting
http://www.inns.net <-- Happy Clients
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive or stories and articles from around the net
http://www2.mrbrklyn.com/downtown.html - See the New Downtown Brooklyn....

____________________________
NYLXS: New Yorker Free Software Users Scene
Fair Use -
because it's either fair use or useless....
NYLXS is a trademark of NYLXS, Inc

  1. 2005-01-31 From: "Martin, Jared" <JMartin-at-dglaw.com> Fw: [hangout] [visham-at-proexam.org: I will like to Register/And I will also like to lern more about this class]
  2. 2005-01-30 From: "P.Robert Marino" <rob-at-concord-hs.org> Re: [hangout] Re: Paid DOE Security Deployment Internship Job Description
  3. 2005-01-30 From: "rc" <ray-pub-at-rcn.com> Subject: [hangout] classes
  4. 2005-01-30 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [hangout] We should Celebrate!
  5. 2005-01-30 From: "Steve Milo" <slavik914-at-mrbrklyn.com> Subject: [hangout] Tax that funded the Spano-American war could be extended
  6. 2005-01-30 From: "Steve Milo" <slavik914-at-mrbrklyn.com> Re: [hangout] January 30, Sunday, Kings Games. Is anybody or everybody going to be there?
  7. 2005-01-30 swd <sderrick-at-optonline.net> Subject: [hangout] January 30, Sunday, Kings Games. Is anybody or everybody going to be
  8. 2005-01-30 From: "Steve Milo" <slavik914-at-mrbrklyn.com> Re: [hangout] Future might be looking brighter
  9. 2005-01-30 Ron Guerin <ron-at-vnetworx.net> Re: [hangout] Future might be looking brighter
  10. 2005-01-29 From: "Steve Milo" <slavik914-at-mrbrklyn.com> Re: [hangout] Future might be looking brighter
  11. 2005-01-29 Billy <billy-at-dadadada.net> Re: Fw: [hangout] [visham-at-proexam.org: I will like to Register/And
  12. 2005-01-29 Billy <billy-at-dadadada.net> Re: [hangout] Re: Paid DOE Security Deployment Internship Job Description
  13. 2005-01-28 From: "Martin, Jared" <JMartin-at-dglaw.com> Fw: [hangout] [visham-at-proexam.org: I will like to Register/And I will also like to lern more about this class]
  14. 2005-01-28 Ruben Safir Secretary NYLXS <ruben-at-mrbrklyn.com> Subject: [hangout] Future might be looking brighter
  15. 2005-01-27 Ruben Safir Secretary NYLXS <ruben-at-mrbrklyn.com> Subject: [hangout] [visham-at-proexam.org: I will like to Register/And I will also like to lern more about this class]
  16. 2005-01-27 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] MySQL installations targeted by Forbot worm variant
  17. 2005-01-27 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] Concerns mount over Lenovo's IBM deal
  18. 2005-01-27 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [hangout] New Cold Medication Restrictions will make them Pharmacy only
  19. 2005-01-27 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [hangout] I've been Robbed - NOT
  20. 2005-01-26 Ruben Safir Secretary NYLXS <ruben-at-mrbrklyn.com> Re: [hangout] Simple C question
  21. 2005-01-26 Billy <billy-at-dadadada.net> Re: [hangout] Simple C question
  22. 2005-01-26 Ruben Safir <ruben-at-mrbrklyn.com> Re: [hangout] Simple C question
  23. 2005-01-26 Ruben Safir <ruben-at-mrbrklyn.com> Re: [hangout] Simple C question
  24. 2005-01-25 From: "rc" <ray-pub-at-rcn.com> Subject: [hangout] FOSS Biz Solution Thoughts?
  25. 2005-01-25 From: "Martin, Jared" <JMartin-at-dglaw.com> RE: [hangout] Simple C question
  26. 2005-01-25 Steve Milo <slavik914-at-mrbrklyn.com> Re: [hangout] Simple C question
  27. 2005-01-25 Billy <billy-at-dadadada.net> Re: [hangout] Simple C question
  28. 2005-01-25 Billy <billy-at-dadadada.net> Re: [hangout] Simple C question
  29. 2005-01-25 James Linder <jhl-at-jlinder.com> Re: [hangout] Simple C question
  30. 2005-01-25 From: "Inker, Evan" <EInker-at-gam.com> RE: [hangout] Simple C question
  31. 2005-01-25 From: "Martin, Jared" <JMartin-at-dglaw.com> Subject: [hangout] Simple C question
  32. 2005-01-25 Ron Guerin <ron-at-vnetworx.net> Re: [hangout] Ron G.
  33. 2005-01-25 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] IBM goes silent on Linux desktop effort
  34. 2005-01-25 From: "Steve Milo" <slavik914-at-mrbrklyn.com> Subject: [hangout] Ron G.
  35. 2005-01-25 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] Flame Wars, Forks and Freedom
  36. 2005-01-24 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] VeriSign breaks silence on domain hijack
  37. 2005-01-23 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [hangout] Mama - don't let your kids grow up to be programers
  38. 2005-01-21 From: "Steve Milo" <slavik914-at-mrbrklyn.com> Subject: [hangout] Paging serge.
  39. 2005-01-20 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] A Take on the Workstation Market Today
  40. 2005-01-20 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] OS News of the Day - Jan 20, 2005
  41. 2005-01-20 From: "Steve Milo" <slavik914-at-mrbrklyn.com> Re: [hangout] FIX Protocol
  42. 2005-01-20 From: "Steve Milo" <slavik914-at-mrbrklyn.com> Subject: [hangout] FIX Protocol
  43. 2005-01-20 From: "Inker, Evan" <EInker-at-gam.com> RE: [hangout] NY Linux Users Grp. 27 Jan. Meeting: Elliotte Rusty
  44. 2005-01-20 From: "Steve Milo" <slavik914-at-mrbrklyn.com> Re: [hangout] NY Linux Users Grp. 27 Jan. Meeting: Elliotte Rusty Harold -on- Extensible Markup Language (XML)
  45. 2005-01-20 Ron Guerin <ron-at-vnetworx.net> Subject: [hangout] NY Linux Users Grp. 27 Jan. Meeting: Elliotte Rusty Harold -on-
  46. 2005-01-20 swd <sderrick-at-optonline.net> RE: [hangout] FIX Protocol
  47. 2005-01-19 From: "Inker, Evan" <EInker-at-gam.com> RE: [hangout] Staff Development and Organizational Capacity
  48. 2005-01-19 Ruben Safir <ruben-at-mrbrklyn.com> RE: [hangout] Staff Development and Organizational Capacity
  49. 2005-01-18 From: "Martin, Jared" <JMartin-at-dglaw.com> RE: [hangout] Staff Development and Organizational Capacity
  50. 2005-01-16 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [hangout] Lotus 1-2-3 Free Software
  51. 2005-01-14 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] FBI may scrap $170 million project
  52. 2005-01-13 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] Linux misperceptions the greatest challenge: Novell
  53. 2005-01-13 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] Red Hat, SuSE release Linux patches
  54. 2005-01-13 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] Red Hat tries again with Linux enthusiasts
  55. 2005-01-13 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] Big Brother Bloomberg is watching.
  56. 2005-01-13 From: "Steve Milo" <slavik914-at-mrbrklyn.com> Subject: [hangout] Paging Serge.
  57. 2005-01-13 Ruben Safir Secretary NYLXS <ruben-at-mrbrklyn.com> Re: [hangout] More wonderful BS from Columbia University
  58. 2005-01-13 Billy <billy-at-dadadada.net> Re: [hangout] Why is he still able to teach!!!
  59. 2005-01-13 Billy <billy-at-dadadada.net> Re: [hangout] More wonderful BS from Columbia University
  60. 2005-01-13 Ruben Safir Secretary NYLXS <ruben-at-mrbrklyn.com> Re: [hangout] More wonderful BS from Columbia University
  61. 2005-01-12 Billy <billy-at-dadadada.net> Re: [hangout] More wonderful BS from Columbia University
  62. 2005-01-12 dspira-at-att.net Subject: [hangout] Why is he still able to teach!!!
  63. 2005-01-12 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [hangout] More wonderful BS from Columbia University
  64. 2005-01-12 From: "Inker, Evan" <EInker-at-gam.com> RE: [hangout] More wonderful BS from Columbia University
  65. 2005-01-12 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [hangout] Open Office and Web Publishing
  66. 2005-01-12 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [hangout] Bird Watching
  67. 2005-01-12 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] GNOME Journal, January 2005 Edition
  68. 2005-01-11 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [hangout] IBM - Software Patents
  69. 2005-01-11 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] NYLXS Needs You !! Call Out for Volunteers
  70. 2005-01-11 Ruben Safir <ruben-at-mrbrklyn.com> Re: [hangout] Staff Development and Organizational Capacity
  71. 2005-01-11 From: "Inker, Evan" <EInker-at-gam.com> RE: [hangout] Staff Development and Organizational Capacity
  72. 2005-01-11 From: "Inker, Evan" <EInker-at-gam.com> Subject: [hangout] Staff Development and Organizational Capacity
  73. 2005-01-11 wjc <wjc-at-optonline.net> Subject: [hangout] test
  74. 2005-01-09 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [hangout] It never ends......
  75. 2005-01-06 Billy <billy-at-dadadada.net> Re: [hangout] What is available for creating GUI's?
  76. 2005-01-06 From: "P.Robert Marino" <rob-at-concord-hs.org> Subject: [hangout] the contract number for the microsoft contract with the NYC DOE
  77. 2005-01-06 From: "Steve Milo" <slavik914-at-mrbrklyn.com> Subject: [hangout] What is available for creating GUI's?

NYLXS are Do'ers and the first step of Doing is Joining! Join NYLXS and make a difference in your community today!