Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Associative containers collections in c++ and c# unordered_map Hashtable 27

  • Arif Mahmood
  • 2018-05-12
  • 119
Associative containers collections in c++ and c# unordered_map Hashtable 27
Associativecontainerscollectionsc plus plusc sharphashmapunorderedHashtabletablekeyvaluefirstsecondvisual studioexamplepptcodetutorialrealinterviewc#c++cppIntroduction of STL Associative ContainersC++ Tutorial for Beginners MapAssociative Containers in C++howto
  • ok logo

Скачать Associative containers collections in c++ and c# unordered_map Hashtable 27 бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Associative containers collections in c++ and c# unordered_map Hashtable 27 или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Associative containers collections in c++ and c# unordered_map Hashtable 27 бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Associative containers collections in c++ and c# unordered_map Hashtable 27

Learn how to define #associative #containers/#collections like #unordered_map and #Hashtable and how to read elements stored in these in c plus plus and c sharp.

c++ code:

#include <iostream> //for cout
#include <fstream> // for ofstream/ifstream
#include <string> //for << and getline
#include <map>//for map
#include <unordered_map>

int main(int argc, char *argv[])
{
std::ifstream input_file("test.txt");
std::ofstream output_file("test.txt.out");

std::string line;

//std::map<std::string, int> elements;//associative
std::unordered_map<std::string, int> elements;

for (int line_no = 1; std::getline(input_file, line); ++line_no)
{
//elements.insert(std::make_pair(line, line_no));
elements.insert({ line, line_no });
//elements[line] = line_no;
}

////std::map<std::string, int>::iterator iter = elements.begin();
//std::unordered_map<std::string, int>::iterator iter = elements.begin();
//for(; iter != elements.end(); iter++)
//{
// std::cout << "LINE " << (*iter).second << ":" << (*iter).first << std::endl;
// output_file << "LINE " << (*iter).second << ":" << (*iter).first << std::endl;
//}

std::cout << elements["This is Arif."] << std::endl;

if (input_file)
{
input_file.close();
output_file.close();
}

std::cin.get();
return 0;
}



c# code:
using System;//for Console
using System.Collections.Generic;//for List and Dictionary
using System.IO;//to use StreamReader
using System.Collections;

namespace lec2csharp
{
class Program
{
static void Main(string[] args)
{
StreamReader input_file = new StreamReader("test.txt");
StreamWriter output_file = new StreamWriter("test.txt.out");

string line = "";

//Dictionary<String, int> elements = new Dictionary<string, int>();
Hashtable elements = new Hashtable();

for (int line_no = 1; (line = input_file.ReadLine()) != null; ++line_no)
{
elements.Add(line, line_no);
//elements[line] = line_no;
}

//foreach (KeyValuePair<string, int> iter in elements)
//{
// Console.WriteLine("LINE {0} :{1}", iter.Value, iter.Key);
// output_file.WriteLine("LINE {0} :{1}", iter.Value, iter.Key);
//}

//foreach (string iter in elements.Keys)
////foreach (int iter in elements.Values)
//{
// Console.WriteLine("LINE {0} ", iter);
// output_file.WriteLine("LINE {0} ", iter);
//}

Console.WriteLine(elements["This is Arif."]);

if (input_file != null)
{
input_file.Close();
output_file.Close();
}

Console.ReadLine();
}
}
}


#cplusplus #csharp #tutorial

C++ Associative containers c# unordered map Hashtable
c++ Associative containers c# map Dictionary
How to use Hashtable in C#

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]