Thread: getting an address of a structs float variable?

  1. #1
    Learner Axel's Avatar
    Join Date
    Aug 2005
    Posts
    335

    getting an address of a structs float variable?

    I'm using sscanf and it requires a pointer as one of its parameters. I want to set a structs variable which is a float. But when i do:

    Code:
    sscanf(buffer,"%f", temp->hourlyRate);
    warning: format argument is not a pointer.

    By the way strings work fine.

    Any ideas?

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Give it a pointer?
    Code:
    sscanf(buffer,"%f", &temp->hourlyRate);
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Promblem with code
    By watchdogger in forum C Programming
    Replies: 18
    Last Post: 01-31-2009, 06:36 PM
  2. Replies: 14
    Last Post: 06-28-2006, 01:58 AM
  3. Class won't call
    By Aalmaron in forum C++ Programming
    Replies: 3
    Last Post: 04-13-2006, 04:57 PM
  4. Could somebody please help me with this C program
    By brett73 in forum C Programming
    Replies: 6
    Last Post: 11-25-2004, 02:19 AM
  5. Repetition in do{}while
    By Beast() in forum C Programming
    Replies: 25
    Last Post: 06-16-2004, 10:47 PM