什么是C ++ API(商业和非商业),它们为满足以下条件提供了简便的方法:

1)表数据结构与Java中的Maps类似(单键和单值),并且对于单值的多个键也是如此。

2)将不同的数据类型转换为STRING值(我的意思是将整数10从“ 10”转换为字符串)

3)提供有关当前日期和时间的信息,并且还应允许在日期上进行空气模拟操作,并且在可能的情况下能够提取检索到的月,日,年,秒和毫秒,这将对您有所帮助。

最佳答案

C ++标准中定义的标准库怎么样?

1)

#include <map> // std::map, key-value pairs, unique keys
               // also contains std::multimap, same as std::map, duplicate keys
// C++11 only:
#include <unordered_map> // std::unordered_map, key-value pairs, unique keys, hash table
                         // also contains std::unordered_multimap


2)

#include <sstream> // std::(i|o)stringstream, allow conversion from / to different data types

// C++11 only:
#include <string>  // std::to_string for arithmetic types to strings (int, double, etc)
                   // std::stoi, std::stol, etc for strings to arithmetic types
// Boost library
#include <boost/lexical_cast.hpp> // boost::lexical_cast for conversions similar to stringstreams


3)

// C standard library, part of C++ standard library
#include <ctime> // std::time, std::gmtime, std::localtime

关于c++ - 使用Maps(HashMap),字符串和日期的最佳C++ API,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8511672/

10-11 23:05
查看更多