Visual Studio sets shortcut snippets
Visual Studio sets shortcut code snippet What is a shortcut code segment:For example: Just enter mst and press TAB to automatically generate the code memset(str, 0, sizeof(str));, just enter Pow to automatically generate a quick code segment. Power functions, etc. are very convenient and fast, which improves the efficiency of writing code to a certain extent How to set a custom code segment in Visual Studio:① Create a new file XXX.snippet, where “XXX” is the above-mentioned “Pow” and “mst”, which is the abbreviation of the code segment ②Copy the following code (I don’t know if different versions of VS are the same. If they are different, you can go to Tools-Shortcut Code Segment to find the ready-made one, and then modify it) <?xml version=”1.0″ encoding=”utf-8″?> <CodeSnippets xmlns=”http:/ /schemas.microsoft.com/VisualStudio/2005/CodeSnippet”> <CodeSnippet Format=”1.0.0 “> Res Res Structure code segment Bycds Expansion SurroundsWith index i Index max length Maximum length <Code Language=”cpp”> <![CDATA[typedef struct Res //Enter the code you want to quickly generate here { int x, y ; bool operator span> < (const Res &b) const { if(x< b.x) return 1 span>; return 0 span>; } }Res; Res s[200005];]]> ③Enter the code segment you need in the CODE location, and be sure to…