Results 1 to 3 of 3

Thread: character array

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Answers
    9

    character array

    what is the difference between char *a & char a[]?


  2. #2
    Junior Member
    Join Date
    Jul 2007
    Answers
    3

    Re: character array

    char *a is a character type pointer variable while char a[] is a single dimensional dynamic character array


  3. #3
    Junior Member
    Join Date
    Oct 2007
    Answers
    3

    Re: character array

    If what you meant is
    what is the difference between char *a="abcd" & char a[]=-"abcd" ?
    What Sahil Jain said applies here also. From usage point of view, the a in a[] is actually a constant pointer and any operations like a++ will generate a compilation error. a++ is perfectly legal for the first case.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact