小编Sai*_*lah的帖子

C++相当于C#的词典和列表

所以在C#中,我有类似于以下内容:

Dictionary<string, List<string>>
Run Code Online (Sandbox Code Playgroud)

在C++中最有效的方法是什么?我知道c ++有'map'和'list'但是我仍处于编写这个函数的伪代码阶段,所以我想知道在C++中是否有这样的东西是可能的.如果是这样,那么制作等效数据结构的最佳方法是什么?

谢谢

c# c++ dictionary list data-structures

4
推荐指数
2
解决办法
3647
查看次数

退出控制台应用程序 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)

c# console logging exit

0
推荐指数
1
解决办法
1736
查看次数

标签 统计

c# ×2

c++ ×1

console ×1

data-structures ×1

dictionary ×1

exit ×1

list ×1

logging ×1