Click here to Skip to main content
15,896,912 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to open .bmp file in paint in MFC? Pin
Code-o-mat22-Nov-08 0:38
Code-o-mat22-Nov-08 0:38 
AnswerRe: How to open .bmp file in paint in MFC? Pin
Hamid_RT22-Nov-08 2:19
Hamid_RT22-Nov-08 2:19 
GeneralRe: How to open .bmp file in paint in MFC? Pin
AnithaSubramani22-Nov-08 2:28
AnithaSubramani22-Nov-08 2:28 
GeneralRe: How to open .bmp file in paint in MFC? Pin
David Crow22-Nov-08 3:34
David Crow22-Nov-08 3:34 
GeneralRe: How to open .bmp file in paint in MFC? Pin
Hamid_RT22-Nov-08 20:30
Hamid_RT22-Nov-08 20:30 
QuestionHow can Release memory controls? Pin
Le@rner21-Nov-08 23:07
Le@rner21-Nov-08 23:07 
AnswerRe: How can Release memory controls? Pin
Randor 22-Nov-08 0:16
professional Randor 22-Nov-08 0:16 
Questionpascal to c code converstion .. Pin
Member 403833521-Nov-08 22:33
Member 403833521-Nov-08 22:33 
i made this code conversion but i have 2 problems there one it works perfectly for a word with 3 chars but it doesnt for a 4 char cant understand why ..
second problem i cant add a simple manu with an if so i can separate the encryption from the decryption ...any ideas how can i do that ..

here is pascal code ...
program shfrovalka;
uses crt;
  var text:string;
  m,k,c,men:integer;
procedure cez(var text:string; var k:integer);
  begin
  clrscr;
   writeln('vvedite isxodniy text ');
    write('$~/> ');
    read(text);
   write('vvedite klu4 shifrovani9 ');
    readln(k);
   for m:=1 to length(text) do
    begin
     c:=ord(text[m])+k;
     if c>256 then c:=c-256;
     text[m]:=chr(c);
    end;
end;
procedure desh (var text:string);
  begin
   writeln('vvedite kluch deshifrovki' );
   readln(k);
    for m:=1 to length(text) do
     begin
      c:=ord(text[m])-k;
       if c<256 then c:=c+256;
      text[m]:=chr(c);
     end;
  end;
begin
  repeat
    clrscr;
    writeln('1 - shifrovka ');
    writeln('2 - deshifrovka ');
    writeln('3 - sosto9nie texta ');
    readln(men);
     case men of
      1:cez(text,k);
      2:desh(text); U?
      3:begin
         writeln(text);
         readkey;
        end;
     end;
  until men = 0;
end.


here is my c code..
#include <stdio.h>
#include <string.h>
#include <conio.h>

char text[256];
int m,k,c,men;

/*Encrypt*/
void cez(char *Text)
{
    printf("%s\n", "give me the text");
    gets(Text);
    printf("%s\n", "give me the key ");
    scanf("%d", &k);

    for(m = 0; m < strlen(text); ++m)
    {
        c = text[m] + k;
        if(c > 256) c -= 256;
        Text[m] = c;
    }    
}
/*Decrypt*/
void desh(char *Text)
{
    printf("%s\n", "give me the decoding key ");
    scanf("%d", &k);

    for(m = 0; m < strlen(text); ++m)
    {
        c = Text[m] - k;
        if(c < 256) c+=256;
        Text[m] = c;
    }
}
int main()
{
    cez(text);
    printf("%s\n", text);
    
    desh(text);
    printf("%s\n", text);

    _getch();
    return 0;
}

AnswerRe: pascal to c code converstion .. Pin
David Crow22-Nov-08 3:29
David Crow22-Nov-08 3:29 
GeneralRe: pascal to c code converstion .. Pin
Member 403833522-Nov-08 5:18
Member 403833522-Nov-08 5:18 
QuestionRe: pascal to c code converstion .. Pin
David Crow22-Nov-08 10:13
David Crow22-Nov-08 10:13 
AnswerRe: pascal to c code converstion .. Pin
Member 403833522-Nov-08 22:02
Member 403833522-Nov-08 22:02 
GeneralRe: pascal to c code converstion .. Pin
David Crow23-Nov-08 12:53
David Crow23-Nov-08 12:53 
QuestionDrag & drop between tree controls [modified] Pin
AnithaSubramani21-Nov-08 19:09
AnithaSubramani21-Nov-08 19:09 
AnswerRe: Drag & drop between tree controls Pin
Code-o-mat22-Nov-08 9:36
Code-o-mat22-Nov-08 9:36 
Questionno border for my form Pin
zon_cpp21-Nov-08 19:05
zon_cpp21-Nov-08 19:05 
AnswerRe: no border for my form Pin
zon_cpp22-Nov-08 1:45
zon_cpp22-Nov-08 1:45 
GeneralRe: no border for my form Pin
Randor 22-Nov-08 2:50
professional Randor 22-Nov-08 2:50 
QuestionContinuesPrinting not working please help me. Pin
Le@rner21-Nov-08 18:17
Le@rner21-Nov-08 18:17 
AnswerRe: ContinuesPrinting not working please help me. Pin
Rajesh Katalkar24-Nov-08 4:54
Rajesh Katalkar24-Nov-08 4:54 
QuestionProblem in debugging [modified] Pin
sen pao21-Nov-08 17:11
sen pao21-Nov-08 17:11 
AnswerRe: Problem in debugging Pin
David Crow21-Nov-08 18:04
David Crow21-Nov-08 18:04 
AnswerRe: Problem in debugging Pin
sen pao21-Nov-08 18:17
sen pao21-Nov-08 18:17 
AnswerNeed Help: How do I assign a Char* To System::String ^ Pin
niiAmoo21-Nov-08 12:35
niiAmoo21-Nov-08 12:35 
GeneralRe: Need Help: How do I assign a Char* To System::String ^ Pin
Saurabh.Garg21-Nov-08 16:43
Saurabh.Garg21-Nov-08 16:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.