More Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mandogon
    New Member
    • Apr 2006
    • 31

    #1

    More Help

    Im having trouble locating the error on this code all help is appricated thank you

    this is the code im working with

    #include "camera.h"
    using namespace std;

    char ending[]="].jpg";

    /* Execute the command using this shell program. */

    void get_real_time(v oid) //FUNCTION PROTOTYPE: get_real_time()

    void get_real_time (void)<-ERROR //FUNCTION: get_real_time:( )

    {
    struct timeval tv;
    time_t curtime;
    gettimeofday(&t v, NULL);
    curtime=tv.tv_s ec;
    strftime(getbuf fer,30,"[%Y-%m-%d][%H-%M-%S-",localtime(&cu rtime));
    milliseconds=tv .tv_usec;
    sprintf(millise condsstr, "%d", milliseconds);
    // convert milliseconds integer to char
    }

    this is the error im getting

    getcamera.cpp:8 : error: expected init-declarator before "void"
    getcamera.cpp:8 : error: expected `,' or `;' before "void"
  • lottalava
    New Member
    • Jul 2006
    • 13

    #2
    You must use ;

    void get_real_time(v oid); //FUNCTION PROTOTYPE: get_real_time()

    Man you need a good IDE to help you with your code, and read some tutorials about C/C++ programming!

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      Originally posted by lottalava
      Man you need a good IDE to help you with your code, and read some tutorials about C/C++ programming!
      A bit strong lottalava, even the most experienced programmers make this sort of typo from time to time.

      What you do learn though mandogon is that a simple typo like this in the right place can produce my tens (even 100s) of errors. Learn to recognise it because as I said if you program for any length of time you will make this mistake more than once.

      Comment

      Working...