当前位置: 首页>>代码示例>>C++>>正文


C++ Count类代码示例

本文整理汇总了C++中Count的典型用法代码示例。如果您正苦于以下问题:C++ Count类的具体用法?C++ Count怎么用?C++ Count使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Count类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

QString
CountLookup::lookupById(Id count_id)
{
    Count count;
    if (count_id != INVALID_ID && _quasar->db()->lookup(count_id, count))
    return count.number();
    return "";
}
开发者ID:cwarden,项目名称:quasar,代码行数:8,代码来源:count_lookup.cpp

示例2: main

int main()
{
    Count C;
    ++C;
    ++C;
    ++C;
    C.display();
}
开发者ID:sathish1000,项目名称:WorkingCode,代码行数:8,代码来源:Overloading.cpp

示例3: main

int main()
{
    Count counter;
    cout << "counter.x after instantiation: ";
    counter.display();
    cout << "counter.x after call to friend function setX():";
    setX(counter, 8);
    counter.display();
}
开发者ID:denghongbo,项目名称:2015,代码行数:9,代码来源:friend_5.cpp

示例4: sizeof

void SseProxy::beginSendingCandidateResults(const Count &count, int activityId)
{
    cout << "SseProxy: beginSendingCandidateResults" << endl;

    DxMessageCode code = BEGIN_SENDING_CANDIDATE_RESULTS;
    int dataLength = sizeof(Count);

    Count marshall = count;
    marshall.marshall();
    sendMessage(code, activityId, dataLength, &marshall);
}
开发者ID:Abhishekpatil,项目名称:SonATA,代码行数:11,代码来源:SseProxy.cpp

示例5: main

int main()
{
   Count counter; // create Count object

   cout << "counter.x after instantiation: ";
   counter.print();

   setX( counter, 8 ); // set x using a friend function
   cout << "counter.x after call to setX friend function: ";
   counter.print();
} // end main
开发者ID:unromanticman,项目名称:C-7E,代码行数:11,代码来源:fig10_15.cpp

示例6: main

int main() {
    Count counter;

    counter.print();

    setX(counter, 8);

    counter.print();

    return 0;
}
开发者ID:qh997,项目名称:CppLearning,代码行数:11,代码来源:fig10_15.cpp

示例7: main

int main(int argc, const char *argv[]) {
    Count counter;

    std::cout << "counter.x after instantiation: ";
    counter.print();

    setX(counter, 8);
    std::cout << "counter.x after call to setX friend function: ";
    counter.print();

    return 0;
}
开发者ID:siidney,项目名称:Cpp-How-To-Program-9E,代码行数:12,代码来源:fig10_13.cpp

示例8: main

int main()
{
   Count counter;                // create counter object 
   Count *counterPtr = &counter; // create pointer to counter
   Count &counterRef = counter;  // create reference to counter

   cout << "Assign 1 to x and print using the object's name: ";
   counter.x = 1;       // assign 1 to data member x
   counter.print();     // call member function print

   cout << "Assign 2 to x and print using a reference: ";
   counterRef.x = 2;    // assign 2 to data member x
   counterRef.print();  // call member function print

   cout << "Assign 3 to x and print using a pointer: ";
   counterPtr->x = 3;   // assign 3 to data member x
   counterPtr->print(); // call member function print

   return 0;  

} // end main
开发者ID:ssvlab,项目名称:esbmc-gpu,代码行数:21,代码来源:main.cpp

示例9: main

int main(int argc, const char * argv[])
{
    Count counter;
    Count *counterPtr=&counter;
    Count &counterRef = counter;
    
    cout<<"Set counter to 1..\n";
    counter.setX(1);
    counter.print();
    
    cout<<"Set counter Ref to 2..\n";
    counterRef.setX(2);
    counter.print();
    
    cout<<"Set counter Ptr to 3..\n";
    counterPtr->setX(3);
    counterPtr->print();

    
    return 0;
}
开发者ID:DachiCoding,项目名称:programming_practice,代码行数:21,代码来源:main.cpp

示例10: main

int main(int argc, char *argv[]) {
    Network yarp;
    Count counter;
    StressPublisher pubs[N];
    StressSubscriber subs[N];
    for (int i=0; i<N; i++) {
        pubs[i].n = i;
        subs[i].n = i;
        pubs[i].counter = &counter;
        subs[i].counter = &counter;
        pubs[i].start();
        subs[i].start();
    }
    printf("Started.....\n");
    for (int i=0; i<N; i++) {
        pubs[i].stop();
    }
    printf("Stopping.\n");
    for (int i=0; i<N; i++) {
        subs[i].stop();
    }
    counter.show();

    for (int i=0; i<N; i++) {
        for (int j=0; j<N; j++) {
            if (!NetworkBase::isConnected(pubs[i].p.getName(),
                                          subs[i].p.getName())) {
                printf(" *** failed to connect %s -> %s\n",
                       pubs[i].p.getName().c_str(),
                       subs[i].p.getName().c_str());
            }
        }
    }

    return 0;
}
开发者ID:robotology,项目名称:yarp,代码行数:36,代码来源:stress_name_server_topics.cpp

示例11: main

int main() {
  Count a;
  a.Show();
  {
    Count b;
    a.Show();
    b.Show();
  }
  a.Show();
}
开发者ID:DaisukeYamato,项目名称:book,代码行数:10,代码来源:StaticMember2.cpp

示例12: main

int main(){
    Count a;
    a.Show();

    // local scope
    {
        Count b;
        a.Show();
        b.Show();
    }
    a.Show();
}
开发者ID:tsuyopon,项目名称:cpp,代码行数:12,代码来源:StaticMember2.cpp

示例13: main

int main(int argc, char **argv) {
    Count counter;
    Count *counterPtr = &counter;
    Count &counterRef = counter;

    counter.setX(1);
    counter.print();

    counterPtr->setX(2);
    counterPtr->print();

    counterRef.setX(3);
    counterRef.print();

    counter.print();
}
开发者ID:qh997,项目名称:CppLearning,代码行数:16,代码来源:fig09_04.cpp

示例14: hashCode

 size_t hashCode(Count const& count) const {
     return count.hash();
 }
开发者ID:,项目名称:,代码行数:3,代码来源:

示例15: canGive

bool Player::canGive(const Count<const Transferable *> & types) const {
    Count<const Transferable *>::const_iterator itr;
    for (itr = types.begin(); itr != types.end(); ++itr)
        if (!canGive(itr->first, itr->second)) return false;
    return true;
}
开发者ID:Apollo999,项目名称:Aftermath,代码行数:6,代码来源:Player.cpp


注:本文中的Count类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。