Browsing all articles tagged with c programming in embedded system - Share Programming Tips
In embedded domain, Copying of structure is why avoided in c programming?
Generally In embedded software domain for copying structure of same type people dont prefer to use direct assignment and do that by memcpy function or by doing assignment of each element of structure.
Look at Example
struct student { int roll_no; int age; }; |
struct student exmple1 = {32,15}; struct student exmple2; |
for copying exmple1 into exmple2.. instead of writing direct
exmple2=exmple1; |
people like to use
memcpy(exmple2,exmple1,sizeof(struct student)); |
or
exmple2.roll_no=exmple1.roll_no; exmple2.age=exmple1.age; |
Why?
Search in this website
our sponsors
latest comments
- venkat on C programming interview questions and answers for freshers
- Ankur on How to configure mail from localhost ( wamp ) using PHP?
- ergVFyd on Huffman Encoding Using Linked List with Source Code
- karthick on how can I write applications in C or C++ for Android?
- karthick on how can I write applications in C or C++ for Android?
Find us on Facebook
Top Authors
Find us on stackoverflow
Polls
Loading ...
My Bookmarks
- Audio/video Recorder & player application based on MATLAB
- check dependency of your binary
- defination of all standard c programming language function
- Great Question-Answer on c programming
- know what your c code means
- Limition of c programming language
- List of all version of c programming language
- Online c compiler
- php freelancing work
- some more stuff on C programming language
- Volatile Keyword in Embedded System
- Write Android application in c language