-8
#include <iostream>
#define NO-EXTER
typedef int snow;
typedef void shells;
typedef char byteUendedLin;
typedef short ANDNOOP;

shells drawsnake(snow size, byteUendedLin *Height__Maskm_, ANDNOOP &Filesz_9Err);

snow main(snow args, byteUendedLin**LOC[])
{
    byteUendedLin *ANDNOEXpfortopoflist[1];
    snow nCagado;
    byteUendedLin *NOTOPS2s3_filenam;
    drawsnake(nCagado, ANDNOEXpfortopoflist, NOTOPS2s3_filenam);
}

shells drawsnake(snow size, byteUendedLin *Height__Maskm_, ANDNOOP &Filesz_9Err);
{
    ANDNOOP Firstbad = 300;
    if(size(Height_Maskm_) >= Firstbad)
    {
        return;
    }
}

}

Output:

1
2
3
4


Line 10: error: missing whitespace after the macro name
In function 'snow main(snow, byteUendedLin***)':
Line 13: error: cannot convert 'byteUendedLin**' to 'byteUendedLin*' 
    for argument '2' to 'shells drawsnake(snow, byteUendedLin*, ANDNOOP&)'
compilation terminated due to -Wfatal-errors.

It seems like the error makes no sense ... what does it mean cannot convert byteUendedLin to a pointer? I don't get it!

PS: Forgive the format; I was using typedefs as experimentation.

sehe
  • 374,641
  • 47
  • 450
  • 633
  • 2
    It also seems like the program makes no sense... please format it properly :) – Andy Prowl Dec 27 '13 at 22:50
  • This seems to be the problem: [What are the valid characters for macro names?](http://stackoverflow.com/questions/369495/what-are-the-valid-characters-for-macro-names) – Jongware Dec 27 '13 at 22:50
  • Also, in the future, you should probably specify what operating system and compiler you're using. There's a lot of variation in the C++ implementations. – BillRobertson42 Dec 27 '13 at 22:52
  • Lots of errors (in addition to what others said): remove the ";" after "ANDNOOP &Filesz_9Err)" Next, "Height_Maskm_" is not the same name as you declared. The prototype for "drawsnake" doesn't match. – Bruce Dean Dec 27 '13 at 22:57
  • Please be more specific what part of the error messages you do not understand. They are quite clear as to what the problem is. – Raymond Chen Dec 27 '13 at 23:07

2 Answers2

3

ANDNOEXpfortopoflist is an array of pointers, which decays to a pointer to a pointer because you pass it as an argument. See How do I use arrays in C++?

You cannot convert T** to T* because T** is not convertible to T*. They are two completely different and unrelated data types. You can dereference a T** to get a T*, though, using the unary * operator.

See this tutorial for an introduction to pointers.


P.S. your program also exhibits undefined behaviour because the identifier Height__Maskm_ is reserved for the implementation.

Community
  • 1
  • 1
2

One problem is:

#define NO-EXTER

This defines a macro NO with the value -EXTER. The compiler wants a space between the macro name and the definition.

Either write:

#define NO -EXTER

or:

#define NO_EXTER

Another problem is your definition of main():

snow main(snow args, byteUendedLin**LOC[])

When you convert the typedefs, that's equivalent to:

int main(int argc, char **argv[])

but the standard requires:

int main(int argc, char **argv)

or

int main(int argc, char *argv[])

or using your typedefs and variable names:

snow main(snow args, byteUendedLin **LOC)
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278