Im getting started will you help me?

This is a discussion on Im getting started will you help me? within the C++ Programming forums, part of the General Programming Boards category; Now, Im reading the tutorials trying to figure out how does this C compiler works exactly but even though I ...

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    1

    Im getting started will you help me?

    Now, Im reading the tutorials trying to figure out how does this C compiler works exactly but even though I have tried everything my first program just won't compile, always returns some errors at the compiler Im using Dev-C++ 4.9.9.2, now theres my code

    Code:
    #include <stdio.h>
    int main()
    {
        printf("show this string\n");
        return 1;
    }
    it says :

    C:/Dev-Cpp/include/stdio.h:405: error: `off64_t' has not been declared

    C:/Dev-Cpp/include/stdio.h:405: error: ISO C++ forbids declaration of `parameter' with no type

    C:/Dev-Cpp/include/stdio.h:412: error: expected init-declarator before "ftello64"

    C:/Dev-Cpp/include/stdio.h:412: error: expected `,' or `;' before "ftello64"

    make.exe: *** [New1.o] Error 1

    can someone explain me what does that means? Im just a beginner at this new language

  2. #2
    Banned Yuri's Avatar
    Join Date
    Aug 2005
    Location
    Breukelen, The Netherlands
    Posts
    133
    This code is C and this section of forum is for C++. Though, this should compile with Dev-C++, it sais you have a problem with you header, maybe you should try to reinstall Dev-C++.

  3. #3
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,479
    A few things:

    1. This is a C++ forum and that is C code.

    2. I compiled it on the same compiler as yours and it works fine, change return 1 to return 0

    3. When you compile it, make sure it reads .c not .cpp under file type, this could be why
    although you can compile C code on a C++ compiler

    4. If you get it to work, try this next

    Code:
    #include <stdio.h>
    
    int main()
    {
    int age;
    
    printf("How old are you: ");
    scanf("%d", &age);
    
    if ( age < 50 )
    {
    printf("\nYou are young!");
    }
    
    else
    {
    printf("\nYou are mature");
    }
    
    getchar();
    
    return 0;
    }

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,825
    > C:/Dev-Cpp/include/stdio.h:405: error: ISO C++ forbids declaration of `parameter' with no type
    This line tells me you tried to compile a C program with a C++ compiler.

    Try naming your program as prog.c rather than prog.cpp (you may need to recreate your project and tick 'c' at the choose language stage).
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help getting started..matrices
    By BobDole11 in forum C Programming
    Replies: 7
    Last Post: 11-15-2008, 09:51 PM
  2. Help getting started :(
    By blackocellaris in forum C Programming
    Replies: 4
    Last Post: 11-05-2006, 06:50 PM
  3. Getting started
    By panzeriti in forum Game Programming
    Replies: 3
    Last Post: 06-28-2003, 11:13 AM
  4. How to get started?
    By anoopks in forum Linux Programming
    Replies: 0
    Last Post: 01-14-2003, 03:48 AM
  5. Need help getting started
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 09-03-2001, 12:08 AM

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