Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- void foo(int &);
- void _strcpy(char *p1, char *p2);
- //////////////////////////////////////////////////////////
- int main()
- {
- char sz1[99];
- char sz2[99] = "SONY";
- int n = 98,
- b = 52;
- _strcpy(sz1, sz2);
- cout << "sz1 = " << sz1 << endl;
- cout << "sz2 = " << sz2 << endl;
- foo(b);
- }
- //////////////////////////////////////////////////////////
- void foo(int &Pushistik)
- {
- cout << Pushistik << endl;
- }
- //////////////////////////////////////////////////////////
- void _strcpy(char *p1, char *p2)
- {
- int n = strlen(p2);
- for(int i = 0; i <= n; i++)
- {
- p1[i] = p2[i];
- }
- }
- // int n = 14; cout << "n = " << n << endl;
- /*
- #include <iostream>
- #include <string>
- using namespace std;
- ////////////////////////
- struct counts
- {
- string name;
- int account;
- double balance;
- };
- //////////////////////////////////////////////////////////
- void change_balance(counts &p, double new_balance)
- {
- p.balance = new_balance;
- }
- //////////////////////////////////////////////////////////
- int main()
- {
- struct counts info;
- double new_balance;
- setlocale(LC_ALL, "rus"); // ijiouoiuoiu
- cout << "Введите номер счета: "; cin >> info.account; cout << endl;
- cout << "Введите имя владельца: "; cin >> info. name;
- cout << "Введите новый баланс: "; cin >> new_balance;
- change_balance(info, new_balance);
- cout << "Ваш счёт: " << info.name << " №" << info.account << " Баланс = " << info.balance << endl;
- return 0;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement