Re: encrypt and decrypt using encrypt(char block[64], int edflag)

From: David Schwartz (davids_at_webmaster.com)
Date: 07/26/04


Date: Sun, 25 Jul 2004 20:58:20 -0700


"rockwell" <rockwell_001@yahoo.com> wrote in message
news:6bbb0df8.0407250040.59273efc@posting.google.com...

> int main(void)
> {
> char key[64];
> char txt[64]="myblockofdata";
>
> strcat(key, "thisismystring");

    Oops. The 'strcat' function requires a pointer to a nul terminated
string for its first parameter. You want 'strcpy', which just needs a
pointer to space in which a string can be held.

    DS



Relevant Pages

  • Re: C Static char* Array Question
    ... Eclipse Warning: passing argument 1 of strcpy discards qualifiers from ... You didn't have a strcpy call in your original article. ... probably trap any attempt to modify a string literal, ... is always to assign the pointer to point to a new string, ...
    (comp.lang.c)
  • Re: Doesnt Wprk - Is There a Way?
    ... The first parameter is the string to convert. ... The third sequence is a final sequence that has ... If the second variable is not a null pointer, ...
    (alt.comp.lang.learn.c-cpp)
  • Is this correct?
    ... is this correct in C or do i have to assign memory block and then ... strcpy the string to pointer. ...
    (comp.lang.c)
  • Re: 2 questions
    ... The strdup() function returns a pointer to a new string ... ... The strcpy() function copies the string pointed to by src (includ­ ...
    (comp.unix.programmer)
  • Re: 2 questions
    ... The strdup() function returns a pointer to a new string ... ... The strcpy() function copies the string pointed to by src (includ­ ...
    (comp.unix.programmer)