Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. const keyword

const keyword

Scheduled Pinned Locked Moved Managed C++/CLI
c++question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lavanya81
    wrote on last edited by
    #1

    Hi, I am new to this forum.I am working as a developper in C programming and working in compiler validation project. I hope I will get good response from u people as soon as possible. My question is : I want what are the possible ways of writing codes using 'const' keyword. I have written some.I need few more. Plz go thru and send me any other cases where we can use const keyword in C only not C++. const int degrees = 360; int const degrees1 = 180; const float pi = 3.14; const char quit = 'q'; int * const var1; const int * var2; int const * var3 const char * const Var4; char const * const Var5; void test1() const; const int * test2(); /* function returns a adress that could not be modified */ void test3(const int *i); const int arr1[]={1,2,3,4,5,6,7}; char const *arr="coderzone";

    C L 2 Replies Last reply
    0
    • L lavanya81

      Hi, I am new to this forum.I am working as a developper in C programming and working in compiler validation project. I hope I will get good response from u people as soon as possible. My question is : I want what are the possible ways of writing codes using 'const' keyword. I have written some.I need few more. Plz go thru and send me any other cases where we can use const keyword in C only not C++. const int degrees = 360; int const degrees1 = 180; const float pi = 3.14; const char quit = 'q'; int * const var1; const int * var2; int const * var3 const char * const Var4; char const * const Var5; void test1() const; const int * test2(); /* function returns a adress that could not be modified */ void test3(const int *i); const int arr1[]={1,2,3,4,5,6,7}; char const *arr="coderzone";

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      This is the Managed C++ forum, C can never be managed, so your question is off topic. Try the visual c++ forum ( or google )

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      1 Reply Last reply
      0
      • L lavanya81

        Hi, I am new to this forum.I am working as a developper in C programming and working in compiler validation project. I hope I will get good response from u people as soon as possible. My question is : I want what are the possible ways of writing codes using 'const' keyword. I have written some.I need few more. Plz go thru and send me any other cases where we can use const keyword in C only not C++. const int degrees = 360; int const degrees1 = 180; const float pi = 3.14; const char quit = 'q'; int * const var1; const int * var2; int const * var3 const char * const Var4; char const * const Var5; void test1() const; const int * test2(); /* function returns a adress that could not be modified */ void test3(const int *i); const int arr1[]={1,2,3,4,5,6,7}; char const *arr="coderzone";

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        there is an infinite number of const constructs; try:

        int const * const * const * const * const * const * const * const * const var;

        :)

        Luc Pattyn


        try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }


        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups