expected primary-expression before ')' token

Hy, I'm trying to understand c++ and made a small programm. after compiling I get several fails:

14 expected primary-expression before ')' token
14 expected `:' before ')' token
14 expected primary-expression before ')' token

does anyone know what causses these failures and how to solve these?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

#include <stdio.h>
#include <stdlib.h>

main ()
{
   int  x, y, z; 
   
   x = 1, y = 1, z = 1;

   printf ( "%d\n", x += y += z );
   printf ( "%d\n", x += y += z );
   printf ( "%d\n", x < y ? x++ : y++ ? );
   
   getchar();
   return ( EXIT_SUCCESS );

I am think the second '?' is unnecessary...
Thanx, you're right, after deleting the 2nd ? it's compiling right. merry x-mas
Topic archived. No new replies allowed.