• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 311, comments - 0, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            指針可以指向基本類型,也可以指向復合類型,因此也可以指向另外一個指針變量,稱為指向指針的指針。

            int i;
            int *pi = &i;
            int **ppi = &pi;

            這樣定義之后,表達式*ppi取pi的值,表達式**ppi取i的值。請讀者自己畫圖理解i、pi、ppi這三個變量之間的關系。

            案例:遞歸查找對象并返回對象指針

            bool CustomEntity::getEntityByPart(const String& partID, graphics::IEntity* inEntity, graphics::IEntity** outEntity)
                    {
                        
            //
                        if (inEntity && (inEntity->getPartID() == partID))
                        {
                            
            return true;
                        }
                        
            //
                        graphics::EntityPtrList::iterator iter;
                        
            if(inEntity->getSkeleton())        
                        {
                            graphics::EntityPtrList entityList 
            = inEntity->getSkeleton()->getEntities(); 
                            
            for (iter =  entityList.begin(); iter != entityList.end(); ++ iter)
                            {
                                graphics::IEntity
            * entity = *iter;                    
                                
            if(getEntityByPart(partID, entity, outEntity))
                                {
                                    
            *outEntity = entity;
                                    
            return true;
                                }
                            }
                        }
                        
            return false;
                    }

                    
            bool CustomEntity::getEntityByPart(const String& partID, graphics::IEntity** outEntity)
                    {
                        
            int num = model_->numComponents();
                        
            for (int i = 0; i < num; ++i)
                        {
                            model::ModelComponent 
            *mc = model_->getComponentByIndex(i);
                            
            if (mc->getType() == model::ModelComponent::MCT_GRAPHIC)
                            {
                                model::Graphical 
            *gc = static_cast<model::Graphical *>(mc);
                                model::Graphical::TagEntityMap::iterator itEntity 
            = gc->entities_.begin();
                                model::Graphical::TagEntityMap::iterator itEnd 
            = gc->entities_.end();
                                
            while (itEntity != itEnd)
                                {
                                    graphics::IEntity
            * entity = itEntity->second.p_;
                                    
            if(getEntityByPart(partID, entity, outEntity))
                                    {
                                        
            *outEntity = entity;
                                        
            return true;
                                    }
                                    
            ++itEntity;
                                }
                            }
                        }
                        
            return false;
                    }
            国内精品伊人久久久久影院对白| 久久激情亚洲精品无码?V| 欧美精品丝袜久久久中文字幕 | 久久伊人五月天论坛| 性做久久久久久久久久久| 国产精品99久久久精品无码| www.久久热.com| 无码人妻少妇久久中文字幕| 久久精品aⅴ无码中文字字幕重口 久久精品a亚洲国产v高清不卡 | 欧美日韩中文字幕久久久不卡| 日产精品久久久一区二区| 国产成人久久精品麻豆一区| 亚洲欧美伊人久久综合一区二区| 99久久婷婷国产一区二区| 色综合久久久久无码专区| 久久久久国产一区二区| 久久久久久综合一区中文字幕| 97久久国产综合精品女不卡| 久久综合九色综合久99| 久久婷婷成人综合色综合| 亚洲欧美成人久久综合中文网| 久久国产高清字幕中文| 亚洲精品乱码久久久久久久久久久久| 国产精品成人99久久久久| 91视频国产91久久久| 久久丫精品国产亚洲av不卡| 国产亚洲精久久久久久无码77777| 久久免费香蕉视频| 香蕉aa三级久久毛片| 精品国产乱码久久久久软件| 久久久久久亚洲精品无码| 九九久久精品无码专区| 久久e热在这里只有国产中文精品99| 色88久久久久高潮综合影院| 热re99久久精品国99热| 天天爽天天狠久久久综合麻豆| 国产成人久久精品一区二区三区| 久久久黄色大片| 国产成人久久精品一区二区三区| 亚洲精品国产美女久久久 | 99久久这里只有精品|