Thread: Tutorials

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    7

    Tutorials

    Here, experienced C++ programmers can give beginners pointers. This is a great beginning program:
    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
      char letter;
    
      cout<<"Please enter a letter: ";
      cin>> letter;
      cin.ignore();
      cout<<"You entered: "<< letter <<"\n";
      cin.get();
    }
    Explanation for code:
    This code reads the letter entered by the user and writes it.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Um... what exactly are you attempting to do? Do you have a question? A series of tutorials already exists on this website. If you feel you can contribute to the references provided, feel free to contact webmaster or kermi3. However, the purpose of this forum is to answer questions that people have concerning their programs.

  3. #3
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    [Not an experienced C++ person.]
    Code:
    using namespace std;
    The above is something to avoid because it generally abrogates the purpose of namespaces.
    Code:
    cin.get();
    The above affectation is generally added in response to a particular IDE rather than being a necessary part of the code.
    Code:
    cin.ignore();
    The above is discussed in the FAQ. It may or may not have the intent of the original programmer.

    [edit]And not returning a value from main may presume previous knowledge of a lengthy history of the C and C++ programming languages.
    Last edited by Dave_Sinkula; 12-23-2005 at 09:47 PM.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  4. #4
    Registered User
    Join Date
    Dec 2005
    Posts
    7
    Sorry, I just took something from when I was starting and reading tuts and copy and pasted what I made. I forgot abouit the unneccessary parts.

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    This site's tutorials are here: http://www.cprogramming.com/tutorial.html
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 04-06-2007, 05:10 PM
  2. Why don't the tutorials on this site work on my computer?
    By jsrig88 in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2006, 10:39 PM
  3. Wiki for Tutorials
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 08-16-2005, 03:03 PM
  4. CProgramming.com should update their tutorials.
    By PorkyChop in forum C++ Programming
    Replies: 17
    Last Post: 09-19-2004, 10:51 PM
  5. Best way to organize tutorials
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 05-30-2004, 04:41 AM