Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

C++: What are the differences between these variable declarations?

What are the differences between the following character/array initializations? Explain how they differ with respects to how I can use them. Also, give me an example where one is guaranteed to work where the other will not.

    char a[4] = "Bus";

    const char * a = "Bus";

    "Bus"

1 Answer

Relevance
  • Anonymous
    9 years ago
    Favorite Answer

    One is local variable and the other is global.

Still have questions? Get your answers by asking now.