4 changed files with 233 additions and 0 deletions
@ -0,0 +1,33 @@ |
|||
#define _CRT_SECURE_NO_DEPRECATE |
|||
#include <iostream>
|
|||
#include <stdbool.h>
|
|||
#include <stdint.h>
|
|||
#include <stdio.h>
|
|||
|
|||
int main(int argc, char const* argv[]) |
|||
{ |
|||
|
|||
if (argc != 2) |
|||
{ |
|||
printf("%s 十六进制的数值\n", argv[0]); |
|||
return -1; |
|||
} |
|||
|
|||
uint64_t input_num = 0; |
|||
sscanf(argv[1], "0x%x", &input_num); |
|||
|
|||
|
|||
int8_t int8_t_value = (int8_t)input_num; |
|||
int16_t int16_t_value = (int16_t)input_num; |
|||
int32_t int32_t_value = (int32_t)input_num; |
|||
int64_t int64_t_value = (int64_t)input_num; |
|||
printf("input : 0x%x\n", input_num); |
|||
printf("========================================\n"); |
|||
printf("= int8_t_value : %d\n", int8_t_value); |
|||
printf("= int16_t_value: %d\n", int16_t_value); |
|||
printf("=int32_t_value: %d\n", int32_t_value); |
|||
printf("= int64_t_value: %ld\n", int64_t_value); |
|||
printf("=\n"); |
|||
|
|||
return 0; |
|||
} |
@ -0,0 +1,31 @@ |
|||
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00 |
|||
# Visual Studio Version 17 |
|||
VisualStudioVersion = 17.0.32014.148 |
|||
MinimumVisualStudioVersion = 10.0.40219.1 |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hex2decimal", "hex2decimal.vcxproj", "{6524BD24-56A7-42CC-BEAE-8BFDA5B9AC6F}" |
|||
EndProject |
|||
Global |
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|||
Debug|x64 = Debug|x64 |
|||
Debug|x86 = Debug|x86 |
|||
Release|x64 = Release|x64 |
|||
Release|x86 = Release|x86 |
|||
EndGlobalSection |
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|||
{6524BD24-56A7-42CC-BEAE-8BFDA5B9AC6F}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{6524BD24-56A7-42CC-BEAE-8BFDA5B9AC6F}.Debug|x64.Build.0 = Debug|x64 |
|||
{6524BD24-56A7-42CC-BEAE-8BFDA5B9AC6F}.Debug|x86.ActiveCfg = Debug|Win32 |
|||
{6524BD24-56A7-42CC-BEAE-8BFDA5B9AC6F}.Debug|x86.Build.0 = Debug|Win32 |
|||
{6524BD24-56A7-42CC-BEAE-8BFDA5B9AC6F}.Release|x64.ActiveCfg = Release|x64 |
|||
{6524BD24-56A7-42CC-BEAE-8BFDA5B9AC6F}.Release|x64.Build.0 = Release|x64 |
|||
{6524BD24-56A7-42CC-BEAE-8BFDA5B9AC6F}.Release|x86.ActiveCfg = Release|Win32 |
|||
{6524BD24-56A7-42CC-BEAE-8BFDA5B9AC6F}.Release|x86.Build.0 = Release|Win32 |
|||
EndGlobalSection |
|||
GlobalSection(SolutionProperties) = preSolution |
|||
HideSolutionNode = FALSE |
|||
EndGlobalSection |
|||
GlobalSection(ExtensibilityGlobals) = postSolution |
|||
SolutionGuid = {B09196DC-33AB-4ABE-BB84-1CE385F09388} |
|||
EndGlobalSection |
|||
EndGlobal |
@ -0,0 +1,147 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|Win32"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Win32"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Debug|x64"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|x64"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<VCProjectVersion>16.0</VCProjectVersion> |
|||
<Keyword>Win32Proj</Keyword> |
|||
<ProjectGuid>{6524bd24-56a7-42cc-beae-8bfda5b9ac6f}</ProjectGuid> |
|||
<RootNamespace>hex2decimal</RootNamespace> |
|||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v143</PlatformToolset> |
|||
<CharacterSet>Unicode</CharacterSet> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<PlatformToolset>v143</PlatformToolset> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<CharacterSet>Unicode</CharacterSet> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v143</PlatformToolset> |
|||
<CharacterSet>Unicode</CharacterSet> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<PlatformToolset>v143</PlatformToolset> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<CharacterSet>Unicode</CharacterSet> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
</ImportGroup> |
|||
<ImportGroup Label="Shared"> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<LinkIncremental>true</LinkIncremental> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<LinkIncremental>false</LinkIncremental> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
<LinkIncremental>true</LinkIncremental> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<LinkIncremental>false</LinkIncremental> |
|||
</PropertyGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<ClCompile> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<SDLCheck>true</SDLCheck> |
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<ConformanceMode>true</ConformanceMode> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Console</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<ClCompile> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<SDLCheck>true</SDLCheck> |
|||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<ConformanceMode>true</ConformanceMode> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Console</SubSystem> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
<ClCompile> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<SDLCheck>true</SDLCheck> |
|||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<ConformanceMode>true</ConformanceMode> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Console</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<ClCompile> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<SDLCheck>true</SDLCheck> |
|||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<ConformanceMode>true</ConformanceMode> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Console</SubSystem> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="hex2decimal.cpp" /> |
|||
</ItemGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
</ImportGroup> |
|||
</Project> |
@ -0,0 +1,22 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<Filter Include="源文件"> |
|||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> |
|||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions> |
|||
</Filter> |
|||
<Filter Include="头文件"> |
|||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> |
|||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> |
|||
</Filter> |
|||
<Filter Include="资源文件"> |
|||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> |
|||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> |
|||
</Filter> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="hex2decimal.cpp"> |
|||
<Filter>源文件</Filter> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
</Project> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue