 안녕하세요!! @wonnieyoon입니다. 오늘은 C++ 구조체에 대해 포스팅하겠습니다. 구조체는 관련있는 변수들끼리 묶어 쉽게 관리하기 위해 사용한다고 생각하시면 될것같습니다.  <b>결과</b>  구조체를 정의하는 방법은 struct 구조체명{ }; 모습을 하게 됩니다. 주의할점은 반드시 끝에 ;이 붙어야 한다는것입니다. 또한 위에 main()함수안에 보면 c와 다른점을 보실수 있습니다. c언어의 경우 typedef를 선언을 했을 경우에만 struct 키워드를 생략할수 있는데 c++언어에서는 typedef선언을 하지 않아도 struct키워드를 생략할수 있습니다.  <b>결과</b>  구조체안에 Get()함수가 정의가 되고 main()에서 호출할수 있습니다. C언어에서는 구조체안에 함수를 선언하는것이 불가능합니다. 하지만 C++ 언어에서는 구조체안에 함수를 선언하는 것이 가능합니다. 또한 함수를 안에서 정의하고 밖으로 빼낼수 있습니다.  ---------------------- <center><목록></center> [1. [C++] 처음부터 시작하는 C++ 1편. 입출력](https://steemit.com/kr-dev/@wonnieyoon/c-c-1) [2. [C++] 처음부터 시작하는 C++ 2편. using,namespace 사용법](https://steemit.com/kr-dev/@wonnieyoon/c-c-2-using-namespace) [3. [C++] 처음부터 시작하는 C++ 3편. 메모리 할당 및 해제( new , delete ) 사용법](https://steemit.com/kr-dev/@wonnieyoon/c-c-3-new-delete)
author | wonnieyoon |
---|---|
permlink | c-c-4-struct |
category | kr-dev |
json_metadata | {"tags":["kr-dev","kr-science","kr","jjangjjangman"],"users":["wonnieyoon"],"image":["https://steemitimages.com/DQmVuxWphCa4QcZMZMPgmKPfz6yS7YiSsMC7W5g67S1QAzr/image.png","https://steemitimages.com/DQmVVKNpSodzDrV57gnApwycdTuJYVEnE3cq5drBhDG1PSN/image.png","https://steemitimages.com/DQmRpLA7AXEzHFbafdaPguMXh68wTSYvJqyYvYXwQZwwKKi/image.png","https://steemitimages.com/DQmVxe8ttNiM7e9UhY6daMGoF9W39RPAWqQgp63uYmka4YH/image.png","https://steemitimages.com/DQmaWR5xcqHNihx8CTx5pEoo4nBp5FBXZXxXK5yTaEDpaWc/image.png","https://steemitimages.com/DQmc1aRKjmw3mymh91RvoNsEMxmTNNP4d4bzmsNHQXdUw9k/image.png"],"links":["https://steemit.com/kr-dev/@wonnieyoon/c-c-1","https://steemit.com/kr-dev/@wonnieyoon/c-c-2-using-namespace","https://steemit.com/kr-dev/@wonnieyoon/c-c-3-new-delete"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-05-14 20:48:18 |
last_update | 2018-05-17 03:56:30 |
depth | 0 |
children | 5 |
last_payout | 2018-05-21 20:48:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 3.026 HBD |
curator_payout_value | 0.788 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,370 |
author_reputation | 5,521,302,527,816 |
root_title | "[C++] 처음부터 시작하는 C++ 4편. 구조체( struct) 사용법" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 55,704,029 |
net_rshares | 778,920,296,985 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
korea | 0 | 129,132,337,770 | 15.04% | ||
asbear | 0 | 58,108,983,857 | 100% | ||
virus707 | 0 | 93,805,831,990 | 1% | ||
beoped | 0 | 20,486,855,649 | 13% | ||
kmlee | 0 | 243,042,892,934 | 21% | ||
wonnieyoon | 0 | 17,396,457,922 | 100% | ||
car-engineer | 0 | 8,833,567,229 | 100% | ||
guangzhoulife | 0 | 98,758,484 | 12% | ||
cjd | 0 | 91,710,113 | 12% | ||
szsys | 0 | 211,728,514 | 12% | ||
papasmf1 | 0 | 2,363,746,322 | 100% | ||
paxnet | 0 | 11,936,429,796 | 100% | ||
boxes | 0 | 121,876,189 | 12% | ||
zcool | 0 | 151,253,667 | 10% | ||
ayay | 0 | 51,942,044 | 13% | ||
abss | 0 | 91,316,829 | 11% | ||
sd974201 | 0 | 294,731,323 | 7% | ||
frontalnh | 0 | 51,972,515 | 10% | ||
pairplay | 0 | 191,952,536,828 | 10% | ||
hopewarm | 0 | 589,102,174 | 100% | ||
aksen | 0 | 106,264,836 | 100% |
구조체라... 지금 배우고 있는 진도랑 벌써 비슷해졌네요 ㅋㅋ 앞으론 여기 글 보면서 예습해도 좋을거 같아요 ㅎㅎ 제가 배우고 있는건 C언어인데 혹시 다음 글부터 C와 C++의 차이점을 조금 더 알려주실수 있으신가요??
author | aksen |
---|---|
permlink | re-wonnieyoon-c-c-4-struct-20180515t050309946z |
category | kr-dev |
json_metadata | {"tags":["kr-dev"],"community":"busy","app":"busy/2.4.0"} |
created | 2018-05-15 05:03:12 |
last_update | 2018-05-15 05:03:12 |
depth | 1 |
children | 0 |
last_payout | 2018-05-22 05:03:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 122 |
author_reputation | 1,599,324,452,023 |
root_title | "[C++] 처음부터 시작하는 C++ 4편. 구조체( struct) 사용법" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 55,761,351 |
net_rshares | 0 |
pairplay 가 kr-dev 컨텐츠를 응원합니다! :)
author | pairplay |
---|---|
permlink | re-wonnieyoon-c-c-4-struct-20180515t003512617z |
category | kr-dev |
json_metadata | "" |
created | 2018-05-15 00:35:15 |
last_update | 2018-05-15 00:35:15 |
depth | 1 |
children | 0 |
last_payout | 2018-05-22 00:35:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 32 |
author_reputation | 49,450,702,071,116 |
root_title | "[C++] 처음부터 시작하는 C++ 4편. 구조체( struct) 사용법" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 55,729,775 |
net_rshares | 0 |
멋진글 잘 보고 갑니다^^
author | papasmf1 |
---|---|
permlink | re-wonnieyoon-c-c-4-struct-20180514t224650486z |
category | kr-dev |
json_metadata | {"tags":["kr-dev"],"app":"steemit/0.1"} |
created | 2018-05-14 22:46:51 |
last_update | 2018-05-14 22:46:51 |
depth | 1 |
children | 0 |
last_payout | 2018-05-21 22:46:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 14 |
author_reputation | 2,679,058,653,767 |
root_title | "[C++] 처음부터 시작하는 C++ 4편. 구조체( struct) 사용법" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 55,717,456 |
net_rshares | 0 |
멋지네요. 오늘 하루 평온하시길ㅎㅎ
author | sd974201 |
---|---|
permlink | re-c-c-4-struct-20180514t205420 |
category | kr-dev |
json_metadata | "" |
created | 2018-05-14 20:54:30 |
last_update | 2018-05-14 20:54:30 |
depth | 1 |
children | 0 |
last_payout | 2018-05-21 20:54:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 19 |
author_reputation | 8,971,135,841,482 |
root_title | "[C++] 처음부터 시작하는 C++ 4편. 구조체( struct) 사용법" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 55,704,786 |
net_rshares | 0 |
짱짱맨 호출에 출동했습니다!!
author | virus707 | ||||||
---|---|---|---|---|---|---|---|
permlink | re-wonnieyoon-c-c-4-struct-1526351643798t08bd8f68-0abd-4a38-8973-7615a95be062uid | ||||||
category | kr-dev | ||||||
json_metadata | {"tags":["support"],"app":"null/null","format":"markdown"} | ||||||
created | 2018-05-15 02:34:09 | ||||||
last_update | 2018-05-15 02:34:09 | ||||||
depth | 1 | ||||||
children | 0 | ||||||
last_payout | 2018-05-22 02:34:09 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 0.000 HBD | ||||||
curator_payout_value | 0.000 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 17 | ||||||
author_reputation | 557,563,606,581,756 | ||||||
root_title | "[C++] 처음부터 시작하는 C++ 4편. 구조체( struct) 사용법" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 55,743,780 | ||||||
net_rshares | 0 |