Like Tree6Likes
  • 5 Post By anduril462
  • 1 Post By Matticus

?

This is a discussion on ? within the C Programming forums, part of the General Programming Boards category; taken from Chapter 8 - steve summit online c tutorial. Code: char string5[20] = "Hello, "; taken from Common Programming ...

  1. #1
    Registered User
    Join Date
    Mar 2012
    Location
    new c-land
    Posts
    84

    ?

    taken from Chapter 8 - steve summit online c tutorial.

    Code:
       char string5[20] = "Hello, ";

    taken from Common Programming Problems in C wiki


    10: Declaring a string with a fixed size and then assigning it to a string literal:

    Code:
       char a[256] = "This doesn't work!";

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,378
    How does it "not work?" What is the error? What compiler are you using?

  3. #3
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,349

    .

    Of course it does.
    Manasij Mukherjee | gcc-4.8.0 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  4. #4
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    4,157
    Please next time actually ask a specific question. I suppose you are asking which of the two conflicting statements is true? Well, Steve Summit is correct. That "Common Programming Problems in C" thing is wrong. If you got it from this website: A Little C Primer/Common Programming Problems in C - Wikibooks, open books for an open world, never, ever go there again for advice. Whoever wrote that is full of !&@#*# and doesn't know what they're talking about.

  5. #5
    Registered User
    Join Date
    Mar 2012
    Location
    new c-land
    Posts
    84
    Sorry, maybe I should have been more explicit. The first line of code is from steve's tutorial, the second is from the online wiki ' Common Programming Problems in C '.

    It's number 10 in their list.

  6. #6
    Registered User
    Join Date
    Jun 2011
    Posts
    1,378
    This is not intended to be rude, but you might get better results if you review this:
    How To Ask Questions The Smart Way
    laserlight likes this.

  7. #7
    Registered User
    Join Date
    Mar 2012
    Location
    new c-land
    Posts
    84
    It doesn't cover DEFENSIVE questions which people ask when they think there is a possibility they have missed something so blindingly obvious that the question is in fact completely and utterly stupid.

    But point taken for future reference.

  8. #8
    Registered User
    Join Date
    Jun 2011
    Posts
    1,378
    In that case, a person should just be clear that they might be missing something obvious. Coupled while the advice from that link, they will have a much better chance of receiving positive responses.

    Happy coding!

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21