所以在C#中,我有类似于以下内容:
Dictionary<string, List<string>>
Run Code Online (Sandbox Code Playgroud)
在C++中最有效的方法是什么?我知道c ++有'map'和'list'但是我仍处于编写这个函数的伪代码阶段,所以我想知道在C++中是否有这样的东西是可能的.如果是这样,那么制作等效数据结构的最佳方法是什么?
谢谢
因此,如果参数检查失败,我将尝试退出控制台应用程序,但是,我仍然希望它记录到文件中。只要所有参数都正确,记录到文件就可以正常工作。但是,当参数检查失败并命中 System.Environment.Exit(0) 部分时,日志文件仍然是完全空的。这是到目前为止的代码。请帮忙,我已经尝试了所有我能想到的。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace I2C_File_Splitter
{
class Program
{
static void Main(string[] args)
{
//get command line input paramaters
using (StreamWriter log = File.AppendText("Splitter_log.txt"))
{
log.WriteLine(DateTime.Now + " ******************************************** SPLITTER STARTED ****************************************************************");
log.WriteLine(DateTime.Now + " FILE: " + args[0] + " DESTINATION: " + args[1] + " MAX COUNT PER FILE: " + args[2]);
if (args.Length == 0)
System.Environment.Exit(0);
string originalFile = args[0];
string destination = args[1];
int …Run Code Online (Sandbox Code Playgroud)