Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- struct Rectangle
- {
- int length;
- int breadth;
- };
- void changeLength( struct Rectangle *p, int l)
- {
- p->length = l;
- }
- int main()
- {
- struct Rectangle r = {10,20};
- changeLength(&r, 20);
- cout << r.length << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement