refencing complex numbers with the Ch compiler

This is a discussion on refencing complex numbers with the Ch compiler within the C Programming forums, part of the General Programming Boards category; I am using a Ch compiler.. I came to know , that this is how we can access the real ...

  1. #1
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342

    refencing complex numbers with the Ch compiler

    I am using a Ch compiler..
    I came to know , that this is how we can access the real and imaginary parts of a complex number in this compiler...

    Code:
        complex sz2;
        printf("sz2 = %f, %f\n", real(sz2),  imag(sz2));
    when i use real() and imag() in my compiler , I get the following messages :

    Code:
      fourier_pc_1d.o(.text+0x157): In function `main':
    : undefined reference to `imag'
    fourier_pc_1d.o(.text+0x181): In function `main':
    : undefined reference to `real'
    Can anyone tell me which library to file to include to get rid of this message?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,333
    Which library does the manual page for those two functions tell you to include?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    silly mistake sorted it out..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with using the return statement
    By mkdl750 in forum C Programming
    Replies: 4
    Last Post: 07-23-2008, 10:14 AM
  2. Need Help With This..
    By Nagisaki in forum C Programming
    Replies: 10
    Last Post: 10-27-2003, 11:17 AM
  3. the definition of a mathematical "average" or "mean"
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 12-03-2002, 10:15 AM
  4. A (complex) question on numbers
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 02-03-2002, 05:38 PM
  5. Need Help with using complex numbers
    By Rich in forum C++ Programming
    Replies: 2
    Last Post: 09-09-2001, 04:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21