Re: Which compiler for a learner of C?



"pkirk25" <patrick@xxxxxxxxx> writes:

[about some implementation]
Actually, while it looks nice enough, it doesn't compile my existing C
code.

.\parameters.cpp(13) : error C2440: 'initializing' : cannot convert
from 'void *' to 'char *'
Conversion from 'void*' to pointer to non-'void' requires an
explicit cast

A file whose name ends in .cpp is generally C++, not C. That's a
C++-specific error. Try renaming it to parameters.c.
--
Here's a tip: null pointers don't have to be *dull* pointers!
.



Relevant Pages

  • Re: ptr conversions and values
    ... it's OK to think of all object pointers as pointing to a byte. ... By adding a forbidden assignment to an allowed conversion? ... > types shall have the same representation. ... > and having the same representation and alignment ...
    (comp.std.c)
  • Re: Functions taking pointers to different types as arguments
    ... Pointers to functions are *interconvertible*. ... Consider int and double: we can take an int value, ... but the conversion has changed things internally. ... use the same representation for int and double. ...
    (comp.lang.c)
  • Re: Where do pointers point to?
    ... >> Suppose an implementation on which alignment is not an issue, and pointers ... pointers get "shifted" during conversion by an arbitrary ... # 13 Within a structure object, the non-bit-field members and the units ... # 14 The size of a union is sufficient to contain the largest of its ...
    (comp.lang.c)
  • Re: bug in visual studio .net 2003 - breakpoints and memcpy
    ... Posix is a standard too with no less (some would say ... > platforms that support the conversion. ... Conversion between code pointers to integers does not exist for the sole ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Conversion function problems
    ... conversion operators are concerned. ... I now think that you are simply disputing my interpretation of the Lippman ... "A conversion function takes the general form ... You will note that Lippman makes no reference at all to pointers, ...
    (comp.lang.cpp)