Guest User

Untitled

a guest
Oct 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <complex.h>
  2. #include <stdint.h>
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7. float complex x = I + I / 3 * I / 2;
  8. short int complex y = I + I / 3 * I / 2;
  9. int16_t complex z = I + I / 3 * I / 2; /* Why ? */
  10. printf("x=(%+f,%+f)n", creal(x), cimag(x));
  11. printf("y=(%+f,%+f)n", creal(y), cimag(y));
  12. printf("z=(%+f,%+f)n", creal(z), cimag(z)); /* Why ? */
  13. return 0;
  14. }
  15.  
  16. In file included from ./complex.c:1:0:
  17. ./complex.c: In function ‘main’:
  18. ./complex.c:9:13: error: two or more data types in declaration specifiers
  19. int16_t complex z = I + I / 3 * I / 2; /* Why ? */
  20.  
  21. gcc-5 --std=c99 ./complex.c -o ./complex
  22. gcc-4.9 --std=c99 ./complex.c -o ./complex
Add Comment
Please, Sign In to add comment