Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- struct Test {
- char* str;
- int n;
- };
- void printTest(Test t)
- {
- cout << t.str << endl;
- cout << t.n << endl;
- }
- int main()
- {
- int n = 1;
- Test* mas = new Test[n];
- mas[0].n = 5;
- mas[0].str = new char[10];
- strcpy(mas[0].str, "Jack");
- printTest(mas[0]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement