C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

why this is not working?

0 votes
30 views
I had the definition char x[6] in one source file, and in another I declared extern char *x. Why didn't it work?
asked May 27, 2011 by daniel Advisor (5,600 points)

1 Answer

0 votes
Hi Daniel,

The declaration extern char *x simply does not match the actual definition. The type "pointer-to-type-T" is not the same as "array-of-type-T." Use extern char x[].

References: CT&P Sec. 3.3 pp. 33-4, Sec. 4.5 pp. 64-5.
answered May 27, 2011 by anonymous

Related questions

+1 vote
2 answers 4,231 views
4,231 views asked Jun 10, 2010 by anonymous
0 votes
1 answer 72 views
72 views asked Jul 20, 2011 by allison Sr Member (1,490 points)
0 votes
1 answer 1,579 views
1,579 views asked May 27, 2011 by albertina Geek (15,670 points)
0 votes
1 answer 1,032 views
1,032 views asked May 27, 2011 by carlton Sr Member (3,990 points)
0 votes
1 answer 428 views
...