Jump to content

ASCII in Linux...


quint

Recommended Posts

Guest ThunderRiver

Mm..good question I never tried :-pI often do this

#include<iostream>using namespace std;int main(){   int number = 0;   for (number = 0; number <= 255; number++)   {      cout << number << " " << (char) number << endl;   }   return 0;}

Compile it using G++ compiler and copy and paste character? *oops*

Link to comment
Share on other sites

Mm..good question I never tried :-pI often do this
#include<iostream>using namespace std;int main(){   int number = 0;   for (number = 0; number <= 255; number++)   {      cout << number << " " << (char) number << endl;   }   return 0;}

Compile it using G++ compiler and copy and paste character? *oops*

Thanks, ThunderRiver, I'll be trying that when I find out about the "G++ compiler", and if I have it. ;)
Link to comment
Share on other sites

Guest ThunderRiver

You do have it. It comes with every single distro out there except a few, like Lycoris or Lindows.Anyway, just copy the code and paste in your favorite editor like emacs and save it as some file likeasci.cppand then fire up the console, and go into the directory where the source code is located and typeg++ asci.cpp -o asciand then type./asci it should show up all the ASCII codesNonetheless, there really should be some easy way to do it. I know there is one..just dunno what it is. I never really had the need to use ASCII code anyway

Link to comment
Share on other sites

You do have it. It comes with every single distro out there except a few, like Lycoris or Lindows.Anyway, just copy the code and paste in your favorite editor like emacs and save it as some file likeasci.cppand then fire up the console, and go into the directory where the source code is located and typeg++ asci.cpp -o asciand then type./asci it should show up all the ASCII codesNonetheless, there really should be some easy way to do it. I know there is one..just dunno what it is. I never really had the need to use ASCII code anyway
Thanks, Thunder. Will try that now. ;)
Link to comment
Share on other sites

Thunder, my son needs it for some school project (says he'll just use Windows :) ); started working out fine, but the last command yielded: permission denied, so I'll log-in as root a little later and try again. Tried from su, but still was denied. Thanks for giving me the right direction to start out with. ;)

Link to comment
Share on other sites

twistedcranium
Thunder, my son needs it for some school project (says he'll just use Windows :) ); started working out fine, but the last command yielded: permission denied, so I'll log-in as root a little later and try again. Tried from su, but still was denied. Thanks for giving me the right direction to start out with. ;)
When you say last command, do you mean the "./asci " command?If so, this brings up a question about setting permissions. Do a ls -la asciand post the results here. You may need to change the execute permissions on the new 'executable' that you just compiled.chmod 755 asci
Link to comment
Share on other sites

Guest ThunderRiver

That's very very odd.Technically the program you compiled under your account belongs to you, so how does it end up that you can execute your own program?

Link to comment
Share on other sites

twistedcranium
That's very very odd.Technically the program you compiled under your account belongs to you, so how does it end up that you can execute your own program?
That is what I was thinking Thunder, the 'permission denied' is puzzling. Although, maybe quint compiled it while under the suwe'll see when he gives us the output of the listing. And I didn't mean to but in on your solution, you're doing a wonderful job!
Link to comment
Share on other sites

Thunder, twistedcranium,Thanks, to you both; beginning to understand little by little - (even though my son no longer needs the output) - I will pursue this, for I think it will have many other applications, in learning this OS.

That is what I was thinking Thunder, the 'permission denied' is puzzling. Although, maybe quint compiled it while under the su
Yes, for some reason had to login as root, to apply it...maybe security set too high? (I'm guessing). Anyway, thanks to you both, and will post my results.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...