search
Login

Categories


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

3.8k questions

4k answers

117 comments

10.7k users

0 votes
32 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 Advisor 5.6k points 1 7 14

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 anonymous

Related questions

1 vote
2 answers 4.3K views
0 votes
1 answer 76 views
76 views
In C arrays why is this true? a[5] == 5[a]
asked allison Sr Member 1.5k points 11 26 40
0 votes
1 answer 1.6K views
1.6K views
what is multi-programming?
asked albertina Geek 15.7k points 5 9 21
0 votes
1 answer 1K views
1K views
What is the return value from printf() function?
asked carlton Sr Member 4k points 5 11 21
0 votes
1 answer 447 views
...