• 2024-06-08c++各种字符串互转(char*、wchar_t*、CString、string、wstring、LPCWSTR)
    1//字符串转换宏2//简写意思:C:const,T:Cstring,W:wstring,A:string34//Cstring转wchar_t*:5wchar_t*p=cstr.AllocSysString()67//Cstring转string:str=CT2A(cstr)8#defineCSTR2STR(cstr)CT2A(cstr)910//Cstring转wstr
  • 2024-04-15const在类和函数之间的运用
    const在类和函数之间的运用第一种情况简单来说就是如果声明了一个const类但是调用了非const的方法.那么编译会不通过->const类只能调用const方法,非const类就都可以调用示例代码:宏定义:#pragma#ifndef__CONST_OBJECT__#define__CONST_OBJECT__​#include<iostream>#incl
  • 2023-08-13快速解决 const 与 typedef 类型组合时 ,const修饰谁的问题
    C++使用typedef给复合类型定义别名时,与const结合会产生看似“令人困惑”的类型推定,例如typedefchar*pstring;constpstringcstr=0;constpstring*ps;cstr到底是什么类型?如果直接把pstring展开成char*,就会认为cstr是constchar*类型,从而认为cstr是一个指向const
  • 2023-07-237/23·morning
    1248:DungeonMaster  http://ybt.ssoier.cn:8088/problem_show.php?pid=1248#include<bits/stdc++.h>usingnamespacestd;chara[103][103][103];intvis[103][103][103];intsx,sy,sz,ex,ey,ez;structqwert{intx,y,z;};intxx[6]={1,-1,0,0,0,0};in
  • 2023-06-19第一次自学VBA
    希望的效果如图所示  SubCopyClassAvgCell()DimaAsRangeDimiAsIntegerDimcellAsStringDimnameCellAsStringDimschoolAvgCellAsStringDimclassAvgCellAsStringDimmergeCellAsStringDimtotalAvgCellAsString
  • 2023-05-21【算法题】骆驼命名法
    题目链接:https://www.nowcoder.com/questionTerminal/aed1c7bbc2604e7c9661a2348b0541b8?answerType=1&f=discussion从C/C++转到Java的程序员,一开始最不习惯的就是变量命名方式的改变。C语言风格使用下划线分隔多个单词,例如“hello_world”;而Java则采用一种叫骆驼命名法的规则:除
  • 2023-04-16算法-二叉树的构造
    namespaceBinary;publicclassBinaryTree{publicNode<char>Head{get;privateset;}privatestringcStr{get;set;}publicBinaryTree(stringconstructStr){this.cStr=constructStr;th