No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
5 Posted Topics
i define a structure that contains a constant member. the problem is, when i use [icode]malloc[/icode] to make such a struct, i fail to initialize its const member, for example: [code] struct C { int* const p; }; int main() { int i = 0; struct C s = { …
are you want something that allows you to define a function in another function?... c / c++ forbid it. you should define [I]long factorial(int);[/I] before [I]main[/I], or leave a declaration before [I]main[/I] and make the implementation anywhere you like. by the way, dont forget return in [I]main[/I].
maybe variant argument list will do ...
c++ regard arrays just as pointers. you'd better use more complex datastruct if some other information like the size of the array is needed.
The End.
Xeuron