Thread: assignment makes pointer from integer without a cast

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    88

    assignment makes pointer from integer without a cast

    2 part question here:


    first of all:

    Code:
    #define _XOPEN_SOURCE
    #include <unistd.h>
    
    char *cryptedpass = malloc(50);
    cryptedpass = crypt(cryptedpass, salt)
    i get the warning msg shown at the subject for this. can anyone explain it means. the second question is how come crypt doesnt work. gcc linker says that its not in unistd.h but the man page disagrees. help?

  2. #2
    Registered User
    Join Date
    Jan 2003
    Posts
    88
    ah, figured this one out myself...the whole problem is that the crypt library was not properly included in compiling so the compiler assumend that the function crypt returned an integer and not a char*.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. warning: cast to pointer from integer of different size
    By DavidDobson in forum C Programming
    Replies: 6
    Last Post: 12-03-2008, 06:37 PM
  2. pointers, structures, and malloc
    By lugnut in forum C Programming
    Replies: 24
    Last Post: 10-09-2008, 04:52 PM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. assignment makes pointer from integer
    By crescen7 in forum C Programming
    Replies: 4
    Last Post: 06-25-2002, 10:08 PM
  5. Replies: 3
    Last Post: 01-14-2002, 12:13 PM