Geeks Talk

Prepare for your Next Interview




character array

This is a discussion on character array within the C and C++ forums, part of the Software Development category; what is the difference between char *a & char a[]?...


Go Back   Geeks Talk > Software Development > C and C++

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-03-2007
Junior Member
 
Join Date: Jul 2007
Posts: 20
Thanks: 5
Thanked 8 Times in 6 Posts
pbchaudhari is on a distinguished road
character array

what is the difference between char *a & char a[]?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-04-2007
Junior Member
 
Join Date: Jul 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
sahil jain is on a distinguished road
Re: character array

char *a is a character type pointer variable while char a[] is a single dimensional dynamic character array
Reply With Quote
  #3 (permalink)  
Old 10-27-2007
Junior Member
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 3 Times in 1 Post
jagatsastry is on a distinguished road
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.
Reply With Quote
The Following 3 Users Say Thank You to jagatsastry For This Useful Post:
Reply

  Geeks Talk > Software Development > C and C++


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
convert one dimansional array to two dimansional array Geek_Guest C and C++ 6 12-22-2007 04:17 AM
static array or dynamic array? rpgubba C and C++ 6 12-22-2007 04:03 AM
Converting single character to string Geek_Guest Java 2 08-24-2007 09:42 AM
HTML/PDF - Newline Character psuresh1982 AJAX & XML 0 07-31-2007 05:37 AM
Buffered InputStream,Buffered Output Stream belongs to either character oriented or s JobHelper Java 1 12-30-2006 07:08 AM


All times are GMT -4. The time now is 09:04 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved