Connecting Tech Pros Worldwide Help | Site Map

difference between?

  #1  
Old June 30th, 2009, 01:55 PM
Newbie
 
Join Date: Jun 2009
Posts: 8
in c (and/or) c++ what is the difference between variables declared as: char[] and char*?

thanks
  #2  
Old June 30th, 2009, 03:06 PM
Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,117
Provided Answers: 6

re: difference between?


Start by reading this.
  #3  
Old July 1st, 2009, 04:12 PM
Expert
 
Join Date: Mar 2008
Location: Naperville, Illinois U.S.
Posts: 804
Provided Answers: 3

re: difference between?


In C ...

If you're talking about the difference between function parameters declared as char[] or char*, then I would say there is absolutely no difference of any kind.

If you're talking about the difference between variables declared as char[N] or char * (where N is an integer), then one additional difference not mentioned in Banfa's link is that sizeof(char[N]) is N, but sizeof(char*) is the size of a pointer.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fundamental difference between Visual Source Safe (VSS) and VSTS Team Foundation bharathreddy insights 0 July 25th, 2007 05:45 AM
Difference between c structure and c++ structure raghunandan_1081@yahoo.com answers 7 May 8th, 2006 11:45 PM
Difference between " and ' b83503104@yahoo.com answers 21 July 23rd, 2005 09:25 AM
What is the difference between DOM Level 1 and DOM Level 2. mike answers 1 July 20th, 2005 08:55 AM
Difference between default arguments and keyword arguments Edward Diener answers 14 July 18th, 2005 11:05 AM