Thread: Hello Everyone I'm learning to code in dev c++ 4.9.8.0 version 2

  1. #16
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>>
    ohh no wonder i was like what is this printf i was about to tell him about the cout etc.. but then i didnt know for sure
    <<<

    printf() is the formatted output statement from the C language. It is included in the ANSI C++ standard, so is valid C++ as well.

    Truth be told, I use printf() in test programs when I want formatted output, with printf() if is a simple function call, with cout and all the necesary manipulators etc., the same job can run to several lines of code!
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  2. #17
    Grammar Police HybridM's Avatar
    Join Date
    Jan 2003
    Posts
    355
    It compiles fine because in C++ if you don't specify a data type for a function it defaults to int.
    Incorrect, this was true in original C++ and (is true?) for C, but standard C++ does not have the default-to-int rule. It compiles fine on dev c++ because it's obviously not standard compliant.
    Thor's self help tip:
    Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.

    OS: Windows XP
    Compiler: MSVC

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. Dev C++ Version 5
    By Zoalord in forum C++ Programming
    Replies: 3
    Last Post: 08-30-2003, 01:56 PM
  3. learning code tags, don't view
    By tagger101 in forum C# Programming
    Replies: 2
    Last Post: 05-21-2003, 03:50 AM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM