Results 1 to 6 of 6
Thread: C++ -
Hybrid View
-
23rd December 2011 22:31 #1Registered User
Join Date: Oct:2008
Location:
Posts: 95
C++ -
,
C++ , . , . , :
1.
, in:Code:#include <iostream> using namespace std; std::string str_return(std::string &in) { std::string temp= in; return temp; } int main () { std::string s = "Mnogo eleni sa se navydili"; cout << str_return(s) << endl; }
in &in ?Code:std::string str_return(std::string in)
2. :
char * s = "Dryn dryn dryn";
char s []= "Dryn dryn dryn";
3. :
int * x;
int* x;
int *x;
(int *) x;
int (* x);
, .
!
-
24th December 2011 12:11 #2
1. . &in str_return(), .
(str_return_ref &):
2.Code:#include <iostream> using namespace std; std::string str_return(std::string in) { in += ", bre!"; std::string temp= in; return temp; } std::string str_return_ref(std::string& in) { in += ", bre!"; std::string temp= in; return temp; } int main () { std::string s = "Mnogo eleni sa se navydili"; cout << str_return(s) << endl; // "Mnogo eleni sa se navydili, bre!" cout << s << endl; // "Mnogo eleni sa se navydili" (s ) cout << str_return_ref(s) << endl; // "Mnogo eleni sa se navydili, bre!" cout << s << endl; // "Mnogo eleni sa se navydili, bre!" (s ). }
3. , 4- - cast, .. int. , unsigned int*, int*.
., . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel
-
24th December 2011 12:25 #3
malloc, void pointer void pointer .Type casting e ASCII char.
ThinkPad T520 ( 4243F53 ) | Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz | Crucial 8GB Ballistix Sport DDR3 @ 1333MHz | SAMSUNG 850 Pro Series ( MZ-7KE128BW ) 128GB 3-D Vertical | Seagate FireCuda Gaming SSHD 2TB ( ST2000LX001 ) | Kernel: 4.4.0-24-generic x86_64 Distro: Ubuntu 16.04 xenial
-
24th December 2011 12:33 #4Registered User
Join Date: Feb:2006
Location: Plovdiv
Posts: 392
-
24th December 2011 12:47 #5
, malloc, new.
ThinkPad T520 ( 4243F53 ) | Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz | Crucial 8GB Ballistix Sport DDR3 @ 1333MHz | SAMSUNG 850 Pro Series ( MZ-7KE128BW ) 128GB 3-D Vertical | Seagate FireCuda Gaming SSHD 2TB ( ST2000LX001 ) | Kernel: 4.4.0-24-generic x86_64 Distro: Ubuntu 16.04 xenial
-
25th December 2011 00:19 #6




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in