Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Cannot use Format for unsigned int
Cannot use Format for unsigned int [message #47946] Wed, 26 April 2017 07:18 Go to previous message
deep is currently offline  deep
Messages: 263
Registered: July 2011
Location: Bangalore
Experienced Member
Hi

Using Win10, MSC15
UPP10943

#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN
{
	int n;
	unsigned int un;
	String s;
	
	n = 1212;
	un = 0x05060708 ;
	
	DUMP(n);
	DUMP(un);
	
	s << Format("%08X" , n) << "\n";
	s << Format("%08X" , un) ;

	DUMP(s);
	
}


I get compile time error
'Upp::Format': none of the 45 overloads could convert all the argument types
for unsigned int variable un

TestFormat.cpp(18): error C2665: 'Upp::Format': none of the 45 overloads could convert all the argument types
\upp\uppsrc\core\Format.h(111): note: could be 'Upp::String Upp::Format(const char *,const Upp::Vector<Upp::Value> &)'
\upp\uppsrc\core\Format.h(106): note: or       'Upp::String Upp::Format(const char *,const Upp::Value &)'
\upp\uppsrc\core\TimeDate.h(154): note: or       'Upp::String Upp::Format(Upp::Time,bool)'
\upp\MyApps\TestFormat\TestFormat.cpp(18): note: while trying to match the argument list '(const char [5], unsigned int)'
TestFormat: 1 file(s) built in (0:04.82), 4828 msecs / file, duration = 4844 msecs, parallelization 0%


MinGW error
error: conversion from 'unsigned int' to 'const Upp::Value' is ambiguous
s << Format("%08X" , un) ;


Warm Regards

Deepak
 
Read Message
Read Message
Read Message
Previous Topic: How to bind parameter to PostCallback with Function, Event object
Next Topic: StringStream has Put,but no Remove funcs
Goto Forum:
  


Current Time: Fri Mar 29 07:14:40 CET 2024

Total time taken to generate the page: 0.01259 seconds