Saturday, May 22, 2010

C Program. Need help?

int addr;


typedef xdata unsigned char * memaddr;





*(memaddr)addr = value;





==%26gt; I am not clear about "*(memaddr)addr = value"


==%26gt; Is it a double pointer or sigle pointer?

C Program. Need help?
Cprogramming.com is a web site designed to help you learn the C or C++ programming languages, and provide you with C and C++ programming language resources. The Getting Started with the C++ language section gives advice about learning C or C++. Learn from our C and C++ language tutorials, or test your programming knowledge with our programming quizzes including the C++ MegaQuiz. If you need help getting set up, check out our compilers page. Don't forget to bookmark this site and check back for our frequent updates.
Reply:typedef is used for give the complex declaration to user desired. if you give


typedef int pint;


we can use pint instead of int.





in your statement


memaddr can be used instead of char *.


So, addr is pointer to pointer.
Reply:i think its a shortcut of pointer using 2 line statement.its a single pointer.coz double pointer means when a pointer is pointing another pointer.but in this case addr is , i think not another pointer just simply variable
Reply:This is a double point, but you will run into issues here.





What you really should be doing is this:





int addr;


addr = (int)value;


No comments:

Post a Comment