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 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 by anonymous

Related questions

+1 vote
2 answers 4,235 views
0 votes
1 answer 72 views
72 views asked by allison Sr Member (1,490 points)
0 votes
1 answer 1,587 views
1,587 views asked by albertina Geek (15,670 points)
0 votes
1 answer 1,039 views
1,039 views asked by carlton Sr Member (3,990 points)
0 votes
1 answer 433 views
...