Thread: ?

  1. #1
    Registered User
    Join Date
    Mar 2012
    Location
    the c - side
    Posts
    373

    ?

    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
    4,513
    How does it "not work?" What is the error? What compiler are you using?

  3. #3
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657

    .

    Of course it does.

  4. #4
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    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
    the c - side
    Posts
    373
    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
    4,513
    This is not intended to be rude, but you might get better results if you review this:
    How To Ask Questions The Smart Way

  7. #7
    Registered User
    Join Date
    Mar 2012
    Location
    the c - side
    Posts
    373
    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
    4,513
    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