Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

c++ concepts

99 views
Skip to first unread message

pvr....@gmail.com

unread,
Feb 6, 2018, 3:27:34 PM2/6/18
to

Louis Krupp

unread,
Feb 7, 2018, 1:05:27 AM2/7/18
to
On Tue, 6 Feb 2018 12:27:22 -0800 (PST), pvr....@gmail.com wrote:

>https://unacademy.com/course/concepts-of-c/38RLD30R

In the above page, "implement" is missing an "i", and there's no need
to capitalize "Programs."

In lesson 2, the first program:

#include <iostream.h>
int main()
{
int n;
n = 4;
cout << n;
return 0;
}

doesn't compile with g++ version 7.2.1:

pvr1.cxx:1:10: fatal error: iostream.h: No such file or directory
#include <iostream.h>

This version of the program compiles, and produces cleaner results
with a newline after the output:

#include <iostream>
int main()
{
int n;
n = 4;
std::cout << n << std::endl;
return 0;
}

Louis

Ian Collins

unread,
Feb 7, 2018, 2:22:46 AM2/7/18
to
On 02/07/2018 07:04 PM, Louis Krupp wrote:
> On Tue, 6 Feb 2018 12:27:22 -0800 (PST), pvr....@gmail.com wrote:
>
>> https://unacademy.com/course/concepts-of-c/38RLD30R
>
> In the above page, "implement" is missing an "i", and there's no need
> to capitalize "Programs."
>
> In lesson 2, the first program:
>
> #include <iostream.h>

Any "tutorial" that includes this should be ignored!

--
Ian.

Cholo Lennon

unread,
Feb 7, 2018, 8:05:10 AM2/7/18
to
You're right. Nowadays it's inadmissible that people still have in their
minds "iostream.h" :-O

But I have to say that it's not weird at all, people in India still use
the ancient Turbo C/C++. Why? it's a mystery to me.

--
Cholo Lennon
Bs.As.
ARG

Öö Tiib

unread,
Feb 7, 2018, 8:52:34 AM2/7/18
to
India's education budget is something like 45 US$ in average per student
annually so nothing mysterious there.
https://en.wikipedia.org/wiki/Education_in_India#/media/File:Elementary_School.jpg

James R. Kuyper

unread,
Feb 7, 2018, 9:21:23 AM2/7/18
to
On 02/07/2018 08:52 AM, Öö Tiib wrote:
> On Wednesday, 7 February 2018 15:05:10 UTC+2, Cholo Lennon wrote:
...
>> But I have to say that it's not weird at all, people in India still use
>> the ancient Turbo C/C++. Why? it's a mystery to me.
>
> India's education budget is something like 45 US$ in average per student
> annually so nothing mysterious there.
> https://en.wikipedia.org/wiki/Education_in_India#/media/File:Elementary_School.jpg

Budget constraints can't be sufficient justification for that choice,
because there are several free compilers, even for Windows, that are
much more up-to-date and do a much better job of compiling the code than
Turbo C/C++.

James R. Kuyper

unread,
Feb 7, 2018, 9:31:09 AM2/7/18
to
On 02/07/2018 06:52 AM, Stefan Ram wrote:
> Louis Krupp <lkr...@nospam.pssw.com.invalid> writes:cleaner results
>> with a newline after the output:
>
> »Whether the last line requires a terminating new-line
> character is implementation-defined.«
>
> ISO C about text streams
>
> C++ inherits this, so a portable program has to terminate
> the last line with a new-line character (also spelt:
> "newline" instead of "new-line").

Perhaps - but the C standard never uses "newline", and the C++ standard
only uses it 4 times, presumably as an editing error. Both standards
overwhelmingly prefer "new-line".

Cholo Lennon

unread,
Feb 7, 2018, 9:50:43 AM2/7/18
to
Well, I don't totally agree with your comment: I am from Argentina (also
I Work for an Indian company). We are not "a first world" country (we
have problems with our free education system too, but maybe it's not
comparable to India), but I stopped using Turbo C/C++ in 1994. There are
no excuses, nowadays you can pick an OS and an up to date C++
compiler/IDE for free.

Regards

Jorgen Grahn

unread,
Feb 7, 2018, 10:24:54 AM2/7/18
to
But we don't know that Turbo C++ is the problem here, do we?
(I didn't watch the video.)

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

Thiago Adams

unread,
Feb 7, 2018, 10:45:47 AM2/7/18
to
On Wednesday, February 7, 2018 at 1:24:54 PM UTC-2, Jorgen Grahn wrote:
> On Wed, 2018-02-07, Cholo Lennon wrote:
> > On 07/02/18 04:22, Ian Collins wrote:
> >> On 02/07/2018 07:04 PM, Louis Krupp wrote:
> >>> On Tue, 6 Feb 2018 12:27:22 -0800 (PST), wrote:
> >>>
> >>>> https://unacademy.com/course/concepts-of-c/38RLD30R
> >>>
> >>> In the above page, "implement" is missing an "i", and there's no need
> >>> to capitalize "Programs."
> >>>
> >>> In lesson 2, the first program:
> >>>
> >>> #include <iostream.h>
> >>
> >> Any "tutorial" that includes this should be ignored!
> >
> > You're right. Nowadays it's inadmissible that people still have in their
> > minds "iostream.h" :-O
> >
> > But I have to say that it's not weird at all, people in India still use
> > the ancient Turbo C/C++. Why? it's a mystery to me.
>
> But we don't know that Turbo C++ is the problem here, do we?
> (I didn't watch the video.)

Turbo C online:
https://www.naclbox.com/gallery/turboc

Turbo C is really good. I wish we had an updated version
but keeping the same simplicity and speed.

Cholo Lennon

unread,
Feb 7, 2018, 12:12:40 PM2/7/18
to
Well... IHMO yes, Turbo C/C++ IS the problem with a great number of
Indian programmers/students, they still use it a lot (just check other
forums like reddit or facebook). My "crystal ball" says the usage of
iostream.h in the metioned course can be traced to Turbo C/C++ ;-)

Real Troll

unread,
Feb 7, 2018, 1:36:03 PM2/7/18
to
On 07/02/2018 17:12, Cholo Lennon wrote:
>
>
> Well... IHMO yes, Turbo C/C++ IS the problem with a great number of
> Indian programmers/students, they still use it a lot (just check other
> forums like reddit or facebook). My "crystal ball" says the usage of
> iostream.h in the metioned course can be traced to Turbo C/C++ ;-)
>
>
If your crystal ball is working correctly then you should have posted a
link to a free update to their 1990 Turbo C compiler/Editor.

<https://www.embarcadero.com/free-tools/ccompiler>

They have starter editions as well that are much better than their
archaic Turbo C.

We should aim to educate people here so that they can spread the word
among their fellow students.


Melzzzzz

unread,
Feb 7, 2018, 1:45:12 PM2/7/18
to
Teachers, teachers, not students ;p
>
>


--
press any key to continue or any other to quit...

Cholo Lennon

unread,
Feb 7, 2018, 2:22:59 PM2/7/18
to
On 07/02/18 15:40, Real Troll wrote:
> On 07/02/2018 17:12, Cholo Lennon wrote:
>>
>>
>> Well... IHMO yes, Turbo C/C++ IS the problem with a great number of
>> Indian programmers/students, they still use it a lot (just check other
>> forums like reddit or facebook). My "crystal ball" says the usage of
>> iostream.h in the metioned course can be traced to Turbo C/C++ ;-)
>>
>>
> If your crystal ball is working correctly then you should have posted a
> link to a free update to their 1990 Turbo C compiler/Editor.
>
> <https://www.embarcadero.com/free-tools/ccompiler>

BCC32C C++ is not the same as Turbo C/C++ (it's not a replacement). The
1st one is just a compiler, the last one is a compiler+IDE (a limited
IDE BTW).

And if I have to recommend a compiler I'd suggest g++/clang instead of
BCC32C. A free compiler+IDE could be Visual Studio Community or Eclipse
CDT + gcc/clang.

>
> They have starter editions as well that are much better than their
> archaic Turbo C.
>

The only free tool is the compiler/linker. Starter editions are not
really free (https://www.embarcadero.com/products/cbuilder/starter)

> We should aim to educate people here so that they can spread the word
> among their fellow students.
>
>

You're right, but IMHO your suggestions are not the best.

Real Troll

unread,
Feb 7, 2018, 2:33:59 PM2/7/18
to
On 07/02/2018 19:22, Cholo Lennon wrote:
>
> BCC32C C++ is not the same as Turbo C/C++ (it's not a replacement).
> The 1st one is just a compiler, the last one is a compiler+IDE (a
> limited IDE BTW).
But that is all they need to start with. If you really feel for them
then ask them to install VS Code free text editor as well and they can
configure it to compile their C++ programs. They can ask you because
you are quite here.

>
> And if I have to recommend a compiler I'd suggest g++/clang instead of
> BCC32C. A free compiler+IDE could be Visual Studio Community or
> Eclipse CDT + gcc/clang.

Did you do that?
>
>>
>>
>>
>
> The only free tool is the compiler/linker. Starter editions are not
> really free (https://www.embarcadero.com/products/cbuilder/starter)

They are free. Have you used them? If not try them before blurping
anything further.
>
>>
>
> You're right, but IMHO your suggestions are not the best.

Fortunately, we have great thinkers and distinguished experts such as
yourself.


>
>
>

Cholo Lennon

unread,
Feb 7, 2018, 3:26:55 PM2/7/18
to
On 07/02/18 16:35, Real Troll wrote:
> On 07/02/2018 19:22, Cholo Lennon wrote:
>>
>> BCC32C C++ is not the same as Turbo C/C++ (it's not a replacement).
>> The 1st one is just a compiler, the last one is a compiler+IDE (a
>> limited IDE BTW).
> But that is all they need to start with.

No. Newbies use Turbo C/C++, among other things, because it's easy to
use. A command line compiler + editor is not the same.


> If you really feel for them
> then ask them to install VS Code free text editor as well and they can
> configure it to compile their C++ programs.  They can ask you because
> you are quite here.

VS code is not a bad idea, +1, I forgot it (and I use it everyday)

>
>>
>> And if I have to recommend a compiler I'd suggest g++/clang instead of
>> BCC32C. A free compiler+IDE could be Visual Studio Community or
>> Eclipse CDT + gcc/clang.
>
> Did you do that?

The same to you... Did you do that? No, you answered me (being pedantic
BTW) not the OP.


>>
>> The only free tool is the compiler/linker. Starter editions are not
>> really free (https://www.embarcadero.com/products/cbuilder/starter)
>
> They are free.  Have you used them?  If not try them before blurping
> anything further.

Yes, I used/use almost all Borland/Embarcaderto tools, including
Sidekick, Quatro Pro, Turbo C/C++/Pascal/Prolog, Turbo Debugger, Turbo
Assembler Borland C++, BDE, Delphi, JBuilder, Kylix and C++ Builder.
Shall I have to justify every sentence to you?


>>
>>>
>>
>> You're right, but IMHO your suggestions are not the best.
>
> Fortunately, we have great thinkers and distinguished experts such as
> yourself.
>

Yeah, I am the best C++ expert in the universe... C'mon. I you cannot
keep an argument without being agressive or pedantic, I'm sorry, I'm
losing my time "real troll"

Richard

unread,
Feb 7, 2018, 3:29:12 PM2/7/18
to
[Please do not mail me a copy of your followup]

Louis Krupp <lkr...@nospam.pssw.com.invalid> spake the secret code
<0d6k7d93hhsl0uhj5...@4ax.com> thusly:

> std::cout << n << std::endl;

Please stop using endl and just use '\n'. There's no need to flush
buffers here.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Terminals Wiki <http://terminals-wiki.org>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>

Scott Lurndal

unread,
Feb 7, 2018, 4:04:10 PM2/7/18
to
legaliz...@mail.xmission.com (Richard) writes:
>[Please do not mail me a copy of your followup]
>
>Louis Krupp <lkr...@nospam.pssw.com.invalid> spake the secret code
><0d6k7d93hhsl0uhj5...@4ax.com> thusly:
>
>> std::cout << n << std::endl;
>
>Please stop using endl and just use '\n'. There's no need to flush
>buffers here.

On unixy systems, '\n' will flush the buffers if they're
marked as line buffered (e.g. stderr is set to line buffered
by the c-runtime initialization code).

Juha Nieminen

unread,
Feb 8, 2018, 12:28:23 AM2/8/18
to
Louis Krupp <lkr...@nospam.pssw.com.invalid> wrote:
> #include <iostream>
> int main()
> {
> int n;
> n = 4;
> std::cout << n << std::endl;
> return 0;
> }

And could we *finally* move past the C style from the 80's? We are in 2018
for f's sake.

Even in C itself it's nowadays ok, and oftentimes even desirable, to
initialize variables when they are declared. In other words:

int n = 4;

David Brown

unread,
Feb 8, 2018, 4:51:55 AM2/8/18
to
That has been allowed (and preferred style, for some of us) since at
least C89, maybe earlier. And since C99 (two decades ago) you have been
able to declare and initialise variables at any point in a block, just
like in C++.
0 new messages