• C

code/array is visible to user & icon

Hi, I opened up my c program in notepad and found that I could see some text that I don't want the user to see.  It's text in one of my arrays.  Is there a way to make my whole code invisible to the user?

My other question is, how do I create my own icon and use it for my c programs?  Don't like the default icon.

LVL 15
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jaime OlivaresSoftware ArchitectCommented:
There are many cryptographic techniques but simplest one is the Caesar algorithm. So you just have to "shift" alphabet, so A=D, B=E, C=F, etc.
Replace you strings with transposed alphabet and before using array into your program, run the decyphering algorithm over the array.
To create an Icon, just use an Icon Editor, there are many at www.download.com
greyknight17Author Commented:
Hi jaime, I actually did read something about this.  So just assign the letter (variable in this case) to another letter?  How would I do this without overlapping each other?  Any program that will make this process more easier?

I know how to create the icon, I want to know how to associate it with my c program.  I don't like the default exe icon.
Jaime OlivaresSoftware ArchitectCommented:
Just have to create you own cyphering and decyphering algorithms, cyphering could be a separated tool you can use any time to input a string and obtaining a "cyphered" string you can copy and paste into your source code. Decyphering algorithm must be into your application. Use any algorithm you want, simple or complex.
To create a simple sustitution algoritm just have to create a constant array with 256 values with  sustituted characters, so you can make a cyphering algorithm like this:

for (i=0; buffer[i]; i++)
    buffer[i] = CYPHER[buffer[i]];

where CYPHER is the array mentioned, something like:

char CYPHER[256] = {
        0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,   /* no sustitution for first characters */
        35,52,86,36,29, ......etcetera

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Get Cisco Certified in IT Security

There’s a high demand for IT security experts and network administrators who can safeguard the data that individuals, corporations, and governments rely on every day. Pursue your B.S. in Network Operations and Security and gain the credentials you need for this high-growth field.

To set an icon to a window you can use the SendMessage function; send a WM_SETICON to a window.
check out MSDN:

this assumes you already know hot to import an icon as a resource: you have to add a line ICON to you .rc file, with the icons path and name. it can also be done using the compiler (Visual C++ 6.0: Import resource)
greyknight17Author Commented:
Thanks stuart for the icon link.  I will take a look at that.

Still having trouble with the cypering though.

I have a dynamic array:

char myarr * []={......

How do I do this then?
greyknight17Author Commented:
I will close this question now since there seems to be no more replies now.

Having a problem with both the icon setting (can't figure out how to link an icon to the program and also can't get the cyphering code to work.  I will close it anyway and split 25 pts for both.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.