473,810 Members | 3,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Variables" tutorial available (Windows, mingw/msvc)

A few days ago I posted an "Hello, world!" tutorial, discussed in <url:
http://groups.google.n o/gr************* *************** **@news.individ ual.net>.

As I wrote then:

<quote>
because there seems to be a lack of post-standard _correct_
tutorials: <url: http://home.no.net/dubjai/win32cpptut/>.
</quote>

This is the follow up, part 02, discussing variables (the directory
referred above contains two documents, part 01 and part 02).

I aim at the complete newbie, but as the earlier debate showed, even for
these fundamental topics there were things to be learned also for far
more experienced C++ folks.

I hope I haven't committed too many errors of my own ( ;-) ), and look
forward to corrections -- just not "it's too long", every word counts.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #1
28 2436
al***@start.no (Alf P. Steinbach) writes:
A few days ago I posted an "Hello, world!" tutorial, discussed in <url:
http://groups.google.n o/gr************* *************** **@news.individ ual.net>. As I wrote then: <quote>
because there seems to be a lack of post-standard _correct_
tutorials: <url: http://home.no.net/dubjai/win32cpptut/>.
</quote>


To put Word docs online to deal with a lack of online post-standard
documentation seems odd to me.
Jul 22 '05 #2
* Tim Love:
al***@start.no (Alf P. Steinbach) writes:
A few days ago I posted an "Hello, world!" tutorial, discussed in <url:
http://groups.google.n o/gr************* *************** **@news.individ ual.net>.

As I wrote then:

<quote>
because there seems to be a lack of post-standard _correct_
tutorials: <url: http://home.no.net/dubjai/win32cpptut/>.
</quote>


To put Word docs online to deal with a lack of online post-standard
documentation seems odd to me.


Yes, it would be (there _is_ no lack of online post-standard
documentation, but there is an apparent lack of online tutorials).

I use Word just for my convenience as writer; feel free to generate PDF
and/or XHTML or whatever -- just include a reference to the original
which might be updated.

For part 01 someone suggested (don't know how seriously) he could
convert to proper HTML, but until someone does, I've reacted to your
feedback by simply also posting Word-generated HTML versions, tested in
Firefox. It works, sort of. But it's not easy on the eye... ;-)

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #3
Page 7, line "Welcome to C++, Målfrid Sæbo!" should probably be
"Welcome to C++, Malfrid Sabo!" since you're trying to show that æøå
changes...?!?

BTW!
Why don't you make a complete book and make it public?
GPL maybe?!?
There are other good books GPL licensed, but none about C++ I think...
That would be GREAT since many people can't afford the prices that the
(good) C++ books are costing and as a consequence therefor buy CRAPPY
books and ends up writing CRAPPY code...!!
Also this would probably "force" schools to use YOUR book instead of
some crappy old junk book teaching all the wrong things...

And also I think in such a chapter it would be apropriate to maybe
introduce command line arguments...?
So maybe instead of reading string from cin parse some command line
arguments and "spit out"...
Might be it's too early to introduce com. line params., but I think not
since you may "push" parts of the understanding forward (pointers,
arrays etc...)

There's a good class in SmartWin (I believe you know where to find it
;) which parses command line params...

BTW2!
Let me know when you finish it if you're going "public" (I think you
know what email address I've got ;) since I would love to host it at
the SmartWin website...
SmartWin draws alot of attention from C++ newbies since it's
syntactically very easy so having a beginners book about the language
there too would be awesome!!

..t

Jul 22 '05 #4
page 14...
"C++ has a bunch of different assignment operators:"

List them all!
Don't leave the readers in vain...
The reader won't care about the list in the first readthrough, but
afterwards when he need a special assignment operator he'll remember
"that book had a list about here..."...

..t

Jul 22 '05 #5
also page 14...
Tell about the difference of:
++x;
and:
x++;
Maybe like:
Expand|Select|Wrap|Line Numbers
  1.  
  2. #include <ostream>
  3. int main()
  4. {
  5. int x = 5;
  6. std::cout << x << std::endl;
  7. std::cout << ++x << std::endl;
  8. std::cout << x << std::endl;
  9. std::cout << x++ << std::endl;
  10. std::cout << x << std::endl;
  11. }
  12.  
  13.  
Yet again, this will be "overkill" for a newbie, but when he needs the
info he'll use the book as a reference...

Also you should probably bring up the "for( int x; x < 5; x++ )"
misunderstandin g...
A lot of programming gurus (from e.g. Java camp) I've met have gotten
this one wrong and thinks that the increment part happens BEFORE the
body of the loop...
I know you're trying to keep a structure in the book where "branching"
probably comes in the chapter AFTER this one, but still it might be
good to at least point to a page in the book or use a footnote about
the issue since it's more "post/pre inc/decr operator" related then
"looping" related...
also:
"OK, what next? I don't know, but probably an overview of built-in
types and operations."
First of all I would have covered all built in types in this chapter,
second I would jump to LOOPS!
Now the reader is Querious, keep him there by showing him some FUN
stuff...

(I remember the days of...)
10 CLS
20 PRINT "Thomas"
30 GOTO 20

....Those were the chapters making it worthwile to read books about
programming....

And btw...
Very good initiative!
When I started C++ I searched the net for a good tutorial and basically
all I found sucked!
This made it MUCH harder for me to learn the language then it would
have been if I had a good tutorial (or bought a good book... ;) )

..t

Jul 22 '05 #6
I did send you the HTML file together with a CSS stylesheet.
Never got the e-mail I've send to you privately?
If so send an email to broeni[skip until @...]@hotmail.com.
Or: should I publish temporarly on my website?

regards,
Stephan Brönnimann
br****@osb-systems.com
http://www.osb-systems.com
Open source rating and billing engine for
communication networks.

Jul 22 '05 #7
* Thomas Hansen:

Page 7, line "Welcome to C++, M=E5lfrid S=E6bo!" should probably be
"Welcome to C++, Malfrid Sabo!" since you're trying to show that =E6=F8=E5
changes...?!?
Nope. I'm not typing those examples in the word processor.

I'm copying them, copy/paste, from my console window so they're
100% accurate for at least _one_ actual Windows setup.

Exception: some places I've changed the filenames afterwards, and just
hope I haven't introduced any errors that way.

Depending on the setup of Windows non-English letters might appear
differently: differently when typed, and when displayed as output from a
program.

Norwegian æ, Æ, å and Å are however part of the original IBM PC English
character code (code page 437). It just lacked ø and Ø, which meant
that for years without end we had to struggle with various custom
encodings resulting in ø and Ø often being rendered as | and \, or as ¢
and ¥, respectively. This ended with the introduction of the Windows
ANSI character code (code page 1252), which is/was based on an early
ANSI draft of what later became ISO Latin-1, the character code I'm
using right here and which is still the most common one on the Usenet
and WWW. For that particular example which involved a round-trip with
no other conversion than the console window's own conversion, æÆåÅ will
typically not be affected, because AFAIK all common Western narrow
character codes that are typical for console Windows have those
characters. However, if the program had tried to open a file with a
name provided by the user, then the user's typing would be in e.g. code
page 437, but in the program and vis-a-vis the Windows API (used at
bottom by C++ file handling) the filename would be interpreted according
to code page 1252, and _all_ of æÆøØåÅ would be affected (no such file).
[snip] And also I think in such a chapter it would be apropriate to maybe
introduce command line arguments...?


Thanks for the suggestion.

Yes it is a problem.

But that requires at minimum indexing, and probably loops to be useful,
which I think is premature at that point (dealing with variables
for the first time, and having to master a lot of seemingly arbitrary &
cryptic tool usage details, having only made "Hello, world!" earlier).

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #8
* Thomas Hansen:
page 14...
"C++ has a bunch of different assignment operators:"

List them all!
Don't leave the readers in vain...
The reader won't care about the list in the first readthrough, but
afterwards when he need a special assignment operator he'll remember
"that book had a list about here..."...

.t


Good point.

Will do.

I thought it was enough to provide a general rule, but now I see that
that rule should be followed by its concrete result: a table listing all
of the assignment operators.

Btw., page numbers seem to depend on e.g. font and page size, it's my
page 13 -- the Bad Luck page! ;-)

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #9
* =?iso-8859-1?q?Stephan_Br= F6nnimann?=:
I did send you the HTML file together with a CSS stylesheet.
Never got the e-mail I've send to you privately?
If so send an email to broeni[skip until @...]@hotmail.com.
Or: should I publish temporarly on my website?


I got it an hour or two ago (I think). Thanks very much. I replied to
your mail then.

The mail account is my web-based Usenet mail account so I don't
check it very often.

I'll send you a mail from my regular account... ;-)

It looked great in FireFox, just some details I saw after replying to
your mail: the special characters arrow -> and left triangle <| were
translated to something and ordinary "<". Right arrow is HTML
"&rarr;" or "→". Left triangle (used for end-of-code) I don't
know, but perhaps just a left arrow instead, "&larr;" or "←"
(which corresponds very nicely with usual rendering of Ctrl Z used as
end-of-file in Windows text files)?

Your website is perhaps best because you can more easily update
changes.

Can I put your HTML version in the same directory as the Word files
(one of my web sites)?

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2018
by: Steven Bethard | last post by:
Philippe C. Martin wrote: > class Debug_Stderr: > __m_text = '' > __m_log_text = None > __m_dbg = None > __m_refresh_count = 0 <rant> I don't see the benefit in 99.9% of cases for making class variables
5
3499
by: j | last post by:
Anyone here feel that "global variables" is misleading for variables whose scope is file scope? "global" seems to imply global visibility, while this isn't true for variables whose scope is file scope. If you have a variable whose scope is file scope in another translation unit, you have to provide a local declaration to access that variable from the other translation unit. Also, I don't see "global variable" used once in the standard....
4
3539
by: BB | last post by:
Hello all, I might be missing something here, but am trying to understand the difference between using application-level variables--i.e. Application("MyVar")--and global variables--i.e. public myVar as string, etc. It seems to me that the scope and duration are the same, as they both are there while the application is running, and both go away when it quits. I presume that one difference is that the application state can be "flushed," such...
8
6857
by: Simone Chiaretta | last post by:
I've a very strange behaveour related to a website we built: from times to times, something should happen on the server, and all static variables inside the web application, both defined inside aspx code-behind and in business logic (C# classes used by the aspx) lose their value. I cannot reproduce this on our development server, so I cannot understand what the cause of all this is. We are using asp.net 1.1 with IIS6 on win2003.
10
6945
by: Bub.Paulson | last post by:
A month ago I finally took the plunge and began learning C# and ASP.Net, coming from a Classic ASP and VBScript background. In my classic ASP, I had my own little library of code that I stuck in an include file called "Common_VBscript.asp" which had all of the common stuff I used. (Constants, Connection Strings, little utlities like "email validation" functions, or functions to ready strings for db entry, etc.) What is the best way...
41
2560
by: none | last post by:
Hello, IIRC, I once saw an explanation how Python doesn't have "variables" in the sense that, say, C does, and instead has bindings from names to objects. Does anyone have a link? Thanks, Ami
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.