code/array is visible to user & icon

Posted on 2004-11-20
Last Modified: 2010-04-15
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.

Question by:greyknight17
    LVL 55

    Expert Comment

    by:Jaime Olivares
    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
    LVL 15

    Author Comment

    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.
    LVL 55

    Accepted Solution

    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
    LVL 1

    Assisted Solution

    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)
    LVL 15

    Author Comment

    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?
    LVL 15

    Author Comment

    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.


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
    This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
    Video by: Grant
    The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
    Video by: Grant
    The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now