#vector #Back
🔵وکتور(vector)
🔹تابع Back
این متد مقدار آخرین عنصر وکتور را به ما می دهد تفاوتش با تابع end( ) این است که end( ) یک iterator به آخرین عنصر به ما می دهد ولی back( ) خود عنصر را به مامی دهد.
🔹مقادیر بازگشتی :
یک ارجاع کامل به آخرین عنصر وکتور.
Output:
myvector contains: 10 9 8 7 6 5 4 3 2 1 0
این برنامه هم با یک الگوریتم خیلی ساده مقادیر 10 تا 0 در یک وکتور می ریزد بعد هم آنها راچاپ میکند. اگر برنامه را ذهنی تریسم کنید به همین خروجی می رسید.
🔰ترجمه شده ازسایت
www.cplusplus.com
@Learncpp
🔵وکتور(vector)
🔹تابع Back
reference back( );
const_reference back( ) const;
این متد مقدار آخرین عنصر وکتور را به ما می دهد تفاوتش با تابع end( ) این است که end( ) یک iterator به آخرین عنصر به ما می دهد ولی back( ) خود عنصر را به مامی دهد.
🔹مقادیر بازگشتی :
یک ارجاع کامل به آخرین عنصر وکتور.
#include <iostream>
#include <vector>
using namespace std;
int main ( )
{
vector<int> myvector;
myvector.push_back(10);
while(myvector.back( ) != 0)
{
myvector.push_back
(myvector.back( ) -1 );
}
cout<<"myvector contains:";
contains:";
for(unsigned i=0;i<myvector.size( ) ;i++)
cout<<' '<<myvector[i];
cout<<'\n';
return 0;
}
Output:
myvector contains: 10 9 8 7 6 5 4 3 2 1 0
این برنامه هم با یک الگوریتم خیلی ساده مقادیر 10 تا 0 در یک وکتور می ریزد بعد هم آنها راچاپ میکند. اگر برنامه را ذهنی تریسم کنید به همین خروجی می رسید.
🔰ترجمه شده ازسایت
www.cplusplus.com
@Learncpp
#vector
📚فهرست آموزش کتابخانه vector(وکتورها)
♦️وکتورچیست
#vector
t.me/Learncpp/550
♦️توضیحات بیشتر درباره وکتور
t.me/Learncpp/551
#pop_back
t.me/Learncpp/552
#push_back
t.me/Learncpp/553
#insert
1. t.me/Learncpp/556
2. t.me/Learncpp/557
#erase
t.me/Learncpp/558
#capacity
t.me/Learncpp/559
#clear
t.me/Learncpp/560
#size
t.me/Learncpp/563
#reserve
t.me/Learncpp/563
#resize
t.me/Learncpp/567
#max_size
t.me/Learncpp/572
#at
t.me/Learncpp/573
#operator
t.me/Learncpp/576
#Empty
t.me/Learncpp/582
#iterator
t.me/Learncpp/584
#Begin
t.me/Learncpp/588
#cbegin
t.me/Learncpp/589
#Rbegin
t.me/Learncpp/590
#crbegin
t.me/Learncpp/591
#End
t.me/Learncpp/595
#cend
t.me/Learncpp/596
#Rend
t.me/Learncpp/597
#crend
t.me/Learncpp/612
#Back
t.me/Learncpp/601
#Emplace
t.me/Learncpp/606
#Emplace_back
t.me/Learncpp/607
#operator
t.me/Learncpp/611
#Front
t.me/Learncpp/613
#swap
1. t.me/Learncpp/616
2. t.me/Learncpp/617
#data
t.me/Learncpp/621
#shrink_to_fit
t.me/Learncpp/625
#vector::vector
1. t.me/Learncpp/632
2. t.me/Learncpp/633
3. t.me/Learncpp/634
#assing
t.me/Learncpp/641
#relation_operator
t.me/Learncpp/652
📝ترجمه کتابخانه از سایت رسمی برنامه نویسان ++C
www.cplusplus.com
🔸کمک به بچه های سرطانی
💝@tabligh_cpp
🔹آموزش تخصصی ++C
🛡@Learncpp
📚فهرست آموزش کتابخانه vector(وکتورها)
♦️وکتورچیست
#vector
t.me/Learncpp/550
♦️توضیحات بیشتر درباره وکتور
t.me/Learncpp/551
#pop_back
t.me/Learncpp/552
#push_back
t.me/Learncpp/553
#insert
1. t.me/Learncpp/556
2. t.me/Learncpp/557
#erase
t.me/Learncpp/558
#capacity
t.me/Learncpp/559
#clear
t.me/Learncpp/560
#size
t.me/Learncpp/563
#reserve
t.me/Learncpp/563
#resize
t.me/Learncpp/567
#max_size
t.me/Learncpp/572
#at
t.me/Learncpp/573
#operator
t.me/Learncpp/576
#Empty
t.me/Learncpp/582
#iterator
t.me/Learncpp/584
#Begin
t.me/Learncpp/588
#cbegin
t.me/Learncpp/589
#Rbegin
t.me/Learncpp/590
#crbegin
t.me/Learncpp/591
#End
t.me/Learncpp/595
#cend
t.me/Learncpp/596
#Rend
t.me/Learncpp/597
#crend
t.me/Learncpp/612
#Back
t.me/Learncpp/601
#Emplace
t.me/Learncpp/606
#Emplace_back
t.me/Learncpp/607
#operator
t.me/Learncpp/611
#Front
t.me/Learncpp/613
#swap
1. t.me/Learncpp/616
2. t.me/Learncpp/617
#data
t.me/Learncpp/621
#shrink_to_fit
t.me/Learncpp/625
#vector::vector
1. t.me/Learncpp/632
2. t.me/Learncpp/633
3. t.me/Learncpp/634
#assing
t.me/Learncpp/641
#relation_operator
t.me/Learncpp/652
📝ترجمه کتابخانه از سایت رسمی برنامه نویسان ++C
www.cplusplus.com
🔸کمک به بچه های سرطانی
💝@tabligh_cpp
🔹آموزش تخصصی ++C
🛡@Learncpp
Telegram
Learning ©➕➕
#vector
🔵 وکتور(vector) چیست
خوب اول ما باید بدونیم وکتور یا همون بردار چیه تا بتونیم تشخیص بدیم که کجا باید ازش استفاده کنیم شما تا حالا حتما از آرایه ها استفاده کردید و حتما بزرگ ترین مشکل آرایه ها رو هم میدونید و اون مشکل همون ثابت بودن طول آرایه است،…
🔵 وکتور(vector) چیست
خوب اول ما باید بدونیم وکتور یا همون بردار چیه تا بتونیم تشخیص بدیم که کجا باید ازش استفاده کنیم شما تا حالا حتما از آرایه ها استفاده کردید و حتما بزرگ ترین مشکل آرایه ها رو هم میدونید و اون مشکل همون ثابت بودن طول آرایه است،…