随笔分类 - C++
摘要:Lists are sequence containers that allow non-contiguous memory allocation. As compared to vector, the list has slow traversal, but once a position has
阅读全文
摘要:Pair is used to combine together two values that may be of different data types. The pair container is a simple container defined in header consisting
阅读全文
摘要:5 ways to create an Array of String Using Pointers Using 2-D Array Using the String Class Using the Array Class Using the Vector Class Conclusion: Out
阅读全文
摘要:They both are resulting in same address but they are different types of addresses. Basically, “array” is a “pointer to the first element of array” but
阅读全文
摘要:argc (ARGument Count) is int and stores number of command-line arguments passed by the user including the name of the program. So if we pass a value t
阅读全文
摘要:1. Constructor Default constructors Parameterized constructors Copy constructors // C++ program to demonstrate constructors #include <bits/stdc++.h> u
阅读全文
摘要:Note In C, all function arguments are passed by value. (including arrays: This means that when an array is passed as an argument to a function, a copy
阅读全文
摘要:https://www.geeksforgeeks.org/scope-of-variables-in-c/
阅读全文
摘要:1. do not need exception message try { // } catch (...) { // } 2. need exception message try { // } catch (const std::exception& e) // reference to th
阅读全文
摘要:1. initial // https://en.cppreference.com/w/c/language/array_initialization 2. get max or min element // array int a[6] = { 1, 45, 54, 71, 76, 12 }; a
阅读全文
摘要:/*************** In for Loop ***************/ // You'd better always use ++i. // Since the logic is the same while i++ needs to save old value before
阅读全文
摘要:Vectors are same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being ha
阅读全文
摘要:1. Common sort Example from cplusplus.com: // sort algorithm example #include <iostream> // std::cout #include <algorithm> // std::sort #include <vect
阅读全文

浙公网安备 33010602011771号