By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,882 Members | 2,082 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,882 IT Pros & Developers. It's quick & easy.

c help

P: 28
can any one tell me the answer to these questions.

1. can we make a .c file (c source file) functionality available to other files with out including this file.any mechanism is there for this one?

2.can .obj(compiled source file in c) file can be used by other source files?

3.can we print individual bytes in a double seperately? there any mechanism to make structure working like a class?

5. can we pass more than two arguments to main function?
Sep 18 '06 #1
Share this Question
Share on Google+
2 Replies

P: 293
5) You can have at most two parameters. However, one parameter is an array, so it can provides as many arguments as you'd like.
Sep 18 '06 #2

Expert Mod 5K+
P: 8,916
1. with out including this file where? In the link no, it's a source file so it shouldn't be included into other files. Without including it's header, yes but it's not good practice

2. what do you mean "used"? Can you included it no, can you link with it and call the functions in it probably.

3.Yes just declare a char pointer at the same address as the double

double d;
char *p = (char *)&d;

4.No need structures and classes already work in exactly the same way. The only difference is that default access in structs is public and in classes is protected.

5. Yes some systems except
int main(int argc, char **argp, char **envp);

envp is a list of environment variables.
Sep 18 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.