{"rsdb":{"rid":"158453","subhead":"","postdate":"0","aid":"118821","fid":"49","uid":"1","topic":"1","content":"
\u6ce8\u610f\uff1a\u6a21\u677f\u7684\u58f0\u660e\u6216\u5b9a\u4e49\u53ea\u80fd\u5728\u5168\u5c40\uff0c\u547d\u540d\u7a7a\u95f4\u6216\u7c7b\u8303\u56f4\u5185\u8fdb\u884c\u3002\u5373\u4e0d\u80fd\u5728\u5c40\u90e8\u8303\u56f4\uff0c\u51fd\u6570\u5185\u8fdb\u884c\uff0c\u6bd4\u5982\u4e0d\u80fd\u5728main\u51fd\u6570\u4e2d\u58f0\u660e\u6216\u5b9a\u4e49\u4e00\u4e2a\u6a21\u677f\u3002<\/p> \n
1\u3001\u51fd\u6570\u6a21\u677f\u7684\u683c\u5f0f\uff1a<\/strong><\/p> \n template\n {<\/strong><\/p> \n \u3000\u3000\u3000\u3000\u3000\u3000\u51fd\u6570\u4f53<\/strong><\/p> \n }<\/strong><\/p> \n \u6a21\u677f\u5b9a\u4e49\u4ee5\u5173\u952e\u5b57template\u5f00\u59cb\uff0c\u540e\u8ddf\u4e00\u4e2a\u6a21\u677f\u53c2\u6570\u5217\u8868\uff0c\u8fd9\u662f\u4e00\u4e2a\u9017\u53f7\u5206\u9694\u7684\u4e00\u4e2a\u6216\u591a\u4e2a\u6a21\u677f\u7684\u5217\u8868\uff0c\u7528< >\u5305\u56f4\u8d77\u6765\u3002class<\/strong>\u53ef\u4ee5\u7528typename<\/strong>\u5173\u89c1\u5b57\u4ee3\u66ff\uff0c\u5728\u8fd9\u91cctypename\u548cclass\u6ca1\u533a\u522b<\/strong>\uff0c<>\u62ec\u53f7\u4e2d\u7684\u53c2\u6570\u53eb\u6a21\u677f\u5f62\u53c2<\/strong>\uff0c\u6a21\u677f\u5f62\u53c2\u548c\u51fd\u6570\u5f62\u53c2\u5f88\u76f8\u50cf\uff0c\u6a21\u677f\u5f62\u53c2\u4e0d\u80fd\u4e3a\u7a7a\u3002<\/strong><\/p> \n \u6ce8\u610f\uff1a\u5bf9\u4e8e\u51fd\u6570\u6a21\u677f\u800c\u8a00\u4e0d\u5b58\u5728h(int,int)<\/strong>\u8fd9\u6837\u7684\u8c03\u7528\uff0c\u4e0d\u80fd\u5728\u51fd\u6570\u8c03\u7528\u7684\u53c2\u6570\u4e2d\u6307\u5b9a\u6a21\u677f\u5f62\u53c2\u7684\u7c7b\u578b\uff0c\u5bf9\u51fd\u6570\u6a21\u677f\u7684\u8c03\u7528\u5e94\u4f7f\u7528\u5b9e\u53c2\u63a8\u6f14\u6765\u8fdb\u884c<\/strong>\uff0c\u5373\u53ea\u80fd\u8fdb\u884ch(2,3)<\/strong>\u8fd9\u6837\u7684\u8c03\u7528\uff0c\u6216\u8005int a, b; h(a,b)<\/strong>\u3002<\/p> \n 2\u3001\u7c7b\u6a21\u677f\u7684\u683c\u5f0f\u4e3a\uff1a<\/p> \n template\n {... };<\/strong><\/p> \n \u7c7b\u6a21\u677f\u548c\u51fd\u6570\u6a21\u677f\u90fd\u662f\u4ee5template<\/strong>\u5f00\u59cb\u540e\u63a5\u6a21\u677f\u5f62\u53c2\u5217\u8868\u7ec4\u6210\uff0c\u6a21\u677f\u5f62\u53c2\u4e0d\u80fd\u4e3a\u7a7a\uff0c\u4e00\u4f46\u58f0\u660e\u4e86\u7c7b\u6a21\u677f\u5c31\u53ef\u4ee5\u7528\u7c7b\u6a21\u677f\u7684\u5f62\u53c2\u540d\u58f0\u660e\u7c7b\u4e2d\u7684\u6210\u5458\u53d8\u91cf\u548c\u6210\u5458\u51fd\u6570\uff0c\u5373\u53ef\u4ee5\u5728\u7c7b\u4e2d\u4f7f\u7528\u5185\u7f6e\u7c7b\u578b\u7684\u5730\u65b9\u90fd\u53ef\u4ee5\u4f7f\u7528\u6a21\u677f\u5f62\u53c2\u540d\u6765\u58f0\u660e\u3002<\/strong><\/p> \n <\/p>\n \u8bfb\u53d6.txt\u6587\u4ef6\u4e2d\u4fdd\u5b58\u7684Inertial measurement units (IMU)\u6570\u636e\uff0c\u5e76\u6839\u636e\u6a21\u7248\u4e2d\u6570\u636e\u7c7b\u578b\u505a\u5bf9\u5e94\u64cd\u4f5c\u3002\u8fd9\u91cc\u5b58\u50a8\u4e86Gyroscope\u3001Accelerometer\u548cMagnetometer\u4f20\u611f\u5668\u7684\u6570\u636e\uff0c\u8fd8\u4fdd\u5b58\u4e86\u91c7\u6837\u65f6\u95f4\u7684\u6570\u636e\u3002\u600e\u4e48\u4f7f\u7528\u6a21\u677f\u6765\u8bfb\u53d6\u8fd9\u4e9b\u5b58\u50a8\u5728txt\u6587\u4ef6\u4e2d\u7684\u6570\u636e\uff1f<\/p> \n <\/p> \n \u5982\u4f55\u6839\u636e\u6a21\u677f\u4e2d\u6570\u636e\u7c7b\u578b\u505a\u5bf9\u5e94\u64cd\u4f5c\uff1f<\/h1> \n
\r\n\/\/sensor\u6570\u636e\u683c\u5f0f\uff0c\u6bcf\u4e2asensor\u5bf9\u5e94\u4e09\u4e2a\u503c\r\nstruct FORMAT\r\n{\r\n\tdouble x;\r\n\tdouble y;\r\n\tdouble z;\r\n};\r\n\r\n\/\/AHRS\u8bb0\u5f55\u7684\u6570\u636e\r\nstruct GYRODATA\r\n{\r\n\tvector\n
\n<\/div>","orderid":"0","title":"\u3010C++ \u6a21\u677f\u3011 \u5982\u4f55\u6839\u636e\u6a21\u7248\u4e2d\u6570\u636e\u7c7b\u578b\u505a\u5bf9\u5e94\u64cd\u4f5c\uff1f","smalltitle":"","mid":"0","fname":"c++\u7f16\u7a0b\u57fa\u7840","special_id":"0","bak_id":"0","info":"0","hits":"7154","pages":"1","comments":"0","posttime":"2017-09-19 13:06:17","list":"1505797577","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"\u6a21\u677f<\/A> \u5982\u4f55<\/A> \u6839\u636e<\/A> \u6a21\u7248<\/A> \u6570\u636e<\/A> \u7c7b\u578b<\/A> \u5bf9\u5e94<\/A> \u64cd\u4f5c<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"113.108.110.181","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"\u3010C++ \u6a21\u677f\u3011 \u5982\u4f55\u6839\u636e\u6a21\u7248\u4e2d\u6570\u636e\u7c7b\u578b\u505a\u5bf9\u5e94\u64cd\u4f5c\uff1f","lastview":"1701971814","digg_num":"1950","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}