Thread: Pointer with strcat() and assignment

  1. #16
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by waqaradil89
    I tried allocating memory but it returns error
    [Error] invalid conversion from 'void*' to 'char*' [-fpermissive]
    That implies that you are trying to compile your C code with a C++ compiler. Time to figure out how to compile as C, or time to change to use a C compiler to compile C code.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #17
    Registered User
    Join Date
    Dec 2014
    Posts
    10
    Quote Originally Posted by laserlight View Post
    That implies that you are trying to compile your C code with a C++ compiler. Time to figure out how to compile as C, or time to change to use a C compiler to compile C code.
    DEV C++ with GCC compiler

  3. #18
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Then ensure that your C source files have a .c file extension. Also, look into the project configuration.

  4. #19
    Registered User
    Join Date
    Dec 2014
    Posts
    10
    Extension is .cpp -_- @laserlight: Appreciated your Diagnosis Thumbs up
    Last edited by waqaradil89; 12-24-2014 at 06:24 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 09-19-2013, 03:51 AM
  2. strcat pointer problem
    By erasm in forum C Programming
    Replies: 15
    Last Post: 09-02-2009, 02:12 AM
  3. Pointer assignment
    By MAx12345 in forum C Programming
    Replies: 16
    Last Post: 07-10-2008, 10:42 PM
  4. Pointer Manipulation with strcat()
    By radiohead in forum C Programming
    Replies: 3
    Last Post: 03-03-2006, 07:17 AM
  5. strcat and pointer problem
    By Harman in forum C Programming
    Replies: 6
    Last Post: 05-10-2005, 05:13 PM

Tags for this Thread