Jump to content

» «

Is C better than vb

30 replies to this topic
  • K^2

    Vidi Vici Veni

  • Sheriff
  • Joined: 14 Apr 2004
  • United-States
  • Best Poster in Technology / Programming 2017
    Best Poster [Technology / Programming] 2016
    Best Poster [Programming] 2015
    Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010


Posted 29 November 2011 - 05:00 AM

QUOTE (RajuGrewal @ Monday, Nov 28 2011, 10:08)
This program in in c not in c++

That program will compile in C or C++, because it uses C libraries. There is no C or C++ specific code anywhere in it.

You can write this in c++ like this..

Not in any compliant compiler. cout is part of the std namespace, so you either have to call it via namespace


Or by selecting the namespace first.

using namespace std;

The civilized way of programming it is by calling it via namespace, but a lot of lazy programmers simply rely on "using" in global scope, and unfortunately, a lot of programming books do the same, resulting in a bunch of people not even understanding what namespaces are and how you use them. No need to go far for example. What you wrote will throw an error "cout was not declared in this scope" in any civilized compiler.

So of the two of you, Swoorup is the one who had the code that would actually compile in ISO C++, and there you go, trying to teach him that it's not C++.

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users