Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 12-30-2004, 06:27 AM   #16 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
There are lots of header files, so there seems a lot to memorize. Don't. Learn the basics as you go (buy that book). The rest is experiance. And there is no shame in reading a reference if you don't know something, or need to know a little extra.

The "std" stands for "standard" indeed. In C++ the current standard (we are talking about the international standard as defined by the ISO comittee) requires to define the standard within the namespace std.
A few rules for the current standard:
- Name C++ headers without the .h extension: <iostream> instead of <iostream.h>
- Old C headers precede with a "c" without the .h extension: <cmath> instead of <math.h> or <math>.

That's right, functions, members and so forth are grouped and defined in specific header files. Here is a picture:
__________________

Last edited by Valmont; 12-30-2004 at 07:03 AM.
Valmont is offline   Reply With Quote
Old 12-30-2004, 10:28 PM   #17 (permalink)
falsepride
Regular Contributor
 
Join Date: Oct 2004
Posts: 227
falsepride is on a distinguished road
one last question about this, the lines useing std:cout; and what not. its saying that your using the function inside the standard namespace. so if i wanted to i could make my own cout function inside a namespace called blah. and if i put using blah::cout; everytime i used cout, it would use my function. and if did std:cout<< "hello word"; it would use the standard cout function. right?
falsepride is offline   Reply With Quote
Old 12-31-2004, 08:10 AM   #18 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Yes, indeed. Well done.
However, one shouldn't redifne C and C++ intrinsic methods and functions. But it is possible.
Look at the 7th post in this thread. That is my post. Check out how I could redefine "dec". Although "dec" is an C++ indentifier.

Here's a little practice for you:
- Make your own abs() function.
- Demonstrate how to use yours, and how to use the one that came with C++.
__________________
Valmont is offline   Reply With Quote
Old 01-04-2005, 12:38 PM   #19 (permalink)
falsepride
Regular Contributor
 
Join Date: Oct 2004
Posts: 227
falsepride is on a distinguished road
Code:
main()
{
     unsigned short x;
     unsigned short y;
     ULONG z;
     z = x * y;
}
what does ulong mean? i know unigned are only positive so the largest is twice as big as a signed, and that int are assumed to be signed if you dont declare them unsigned. and i know that if their short, that it just means their shorter and use less mememory, and the number of bytes they use varies from computers, but what does ulong mean?
falsepride is offline   Reply With Quote
Old 01-04-2005, 01:00 PM   #20 (permalink)
falsepride
Regular Contributor
 
Join Date: Oct 2004
Posts: 227
falsepride is on a distinguished road
ohhh nvm, i got it, ULONG is a typedef. the book im using "Learn C++ in 21 Days", or something like that, is pissing me off. it uses things in code examples and doesnt explain them untill later on in that page.
falsepride is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Return of the Variant (Good or Bad?) RobertStout Lounge 3 10-26-2004 01:41 PM
OpenGL.dll Mr.Anderson Platform/API C++ 3 08-13-2004 11:07 AM
MySQL Return closest matches? Admin PHP 4 07-22-2004 04:45 PM
From C to Java HighterDK Java 11 07-13-2004 08:15 PM


All times are GMT -8. The time now is 05:51 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting