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++ Library : Other (not classified elsewhere) » Using openssl functions on U++
Re: Using openssl functions on U++ [message #13089 is a reply to message #13088] Mon, 10 December 2007 05:35 Go to previous messageGo to previous message
waxblood is currently offline  waxblood
Messages: 95
Registered: January 2007
Member
U++ is written in standard C++, but it douesn't use c++ standard template library (stl) for efficiency reasons, so you should avoid using anything which is included in std namespace - you could start by not writing using namespace std at all for example Wink


This is the corrected version of your program:

// not needed std stuff
//#include <iostream> 

#include <Web/Web.h>

//not needed, too
//using namespace std; 

using namespace UPP; //write this, otherwise upp functions won't get recognised



int main()
{
char *text = "Hola a todos";

String salida; //in this case seems better to use String - NOTE: this is Ultimate++ String, not std::string

//text = "Hola a todos"; // you can write a thing like this only at initialization time

salida = Base64Encode(MD5Digest(text)); // if you write *text you pass MD5Digest a _single_ char, not a vector of chars


//Upp way to std::cout is writing Cout()
Cout() << "Salida en base64 para la digestion de " << text << " = " << salida;

return 0; //Why return 1? If we got so far return 0 (no error) seems better
}


I suggest you to read :

String tutorial
http://www.ultimatepp.org/srcdoc$Core$CoreTutorial$en-us.htm l

As for String/char* conversions,

http://www.ultimatepp.org/forum/index.php?t=msg&goto=125 11&#msg_12511


David

[Updated on: Mon, 10 December 2007 05:42]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: pointer to exe in memory?
Next Topic: bug with displayPopUp with MT
Goto Forum:
  


Current Time: Sun Jun 29 14:55:54 CEST 2025

Total time taken to generate the page: 0.04771 seconds