Please
ok can any one give me the code to this im making a program and it needs this and im stuck please give code asap
application that will convert any text I throw at it to hex
Thank You

This is slightly confusing. You say:

can any one give me the code to this?

But you also say:

im making a program a

Why would you need the code, when you're making it yourself? And to make matters even more confusion, your signature says:

Learn To Code Don't Steal Other's

So why won't you make this yourself? Have you read this? :icon_wink:

Also: There's a shift-key on your keyboard which (in combination with a letter) produces a Capital-letter.
Also: dots. Learn to use them.

One I do know how to use shift.
Two I am making the program.
Three I do not know how to have text go to hex in C++.
Four my sig is like that because to many people steal my work, and if some one did give me the code i was gonna credit it them with;

// Your Name Here Help Me On The Hex Part!

This Is Not Homework this program that will take text you type and lets you choose what it comes out as I already have...DONE = Green Not-Done =Red
Html
Java
Php
C++

Flash
Hex

Flash i can do i just can not do hex

Four my sig is like that because to many people steal my work, and if some one did give me the code i was gonna cred it them with

// Your Name Here Help Me On The Hex Part!

Oh wow! Then I'll help you immediately:

#include <iostream>
int main(){
    int number = 30;
    std::cout << std::hex << number;
}

don't forget to put the credits in the codez!

Thank You That's All I Needed!

ok i keep geting this.. 1ePress Any Key To Continue

here is the code

#include <iostream>

int main(){
// niek_e Helped Me On Hex Part!
int number = 30;
std::cout << std::hex << number;

Yeah the int 30 converted to hex is 1E. The press any key to contiune is because thats then end of the program. cout << hex << number << endl; This will space them out so you can see what is going on better.

As for converting text to hex you might want to take user input as a string then take the string and go through each element and convert that into hex.

--Why do people not just put using namespace std; no one uses namespaces any more.

--Why do people not just put using namespace std; no one uses namespaces any more.

I am using namespaces. And I'm using them the way they were intended. Let's say you have 2 namepspaces: foo and bar and they both have the function toString() in them. How are you supposed to know which one to use if you just say

using namespace foo;
 using namespace bar;

std::string abc = toString(1); // BIG problem

?

If you use this for example, you won't have a problem:

using foo::toString;
 using bar::otherFunction;

std::string abc = toString(1); // NO problem

Or my preferred way:

std::string abc = foo::toString(1); // NO problem
std::string abc2 = bar::toString(1); // NO problem

namespaces are out of date IMO so if you are using them I think you are just making stuff more complex.

namespaces are out of date IMO so if you are using them I think you are just making stuff more complex.

Interesting point of view. Would you like to explain why you think namespaces are outdated? (I know this is going off-topic, but perhaps it'll trigger some interesting discussion and I'll break this thread in half)

The main namespace people use is std. I don't know anyone and haven't seen any posts where people make their own namespace.

I haven't posted any major projects here. But when I make project with > 100.000 lines for example, you can be sure that there are a few namespaces in it :)
Saying: "I haven't seen them here", "They are outdated" or two very different things.

commented: Very true. +9
commented: Rep for question 1 being solved. +2

I don't know anyone and haven't seen any posts where people make their own namespace.

You need to meet more C++ programmers then. Custom namespaces are all over the place, for good reason. I just debugged my own (very short) project. The culprit? I had several functions called "GetSQLCommand" and I put one of them in the wrong namespace.

I don't know anyone and haven't seen any posts where people make their own namespace.

Now you know another, my entire personal library is wrapped in a number of namespaces, without them it would be chaos.

Well I'll look into them a bit more and learn more about them thanks for showing me that they aren't out of date.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.