Thread: refencing complex numbers with the Ch compiler

  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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    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.

  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, 12:17 PM
  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, 11:15 AM
  4. A (complex) question on numbers
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 02-03-2002, 06: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