Im confused about this.

I read this in a tutorial:

Literal constants, like variables, are considered to have a specific data type. By default, integer literals are of type int. However, we can force them to either be unsigned by appending the u character to it, or long by appending l:

75     // int
75u // unsigned int
75l // long
75ul // unsigned long

I underlined what I dont understand. I know unsigned means that its a positive
or negative but what does long mean

I also have another question. After reading a tutorial, I was supposed to put this code into the thing:

#include <iostream>
using namespace std;

#define PI 3.14159
#define NEWLINE '/n';

int main() {
double r=5.0;
double circle;

circle = 2*PI*r;
cout << circle;
cout << NEWLINE;
return 0;
}

The only thing I dont understand is the double part. Whats that mean





Answer this question

Im confused about this.

  • Ovesen

    Try VC++ Help | Index search on "double data type". There's far more in the Help for VC++ 2005 Express Edition. It's a great resource.

    You can download free electronic books on C++ too (see http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=446165&SiteID=1), and there are some very affordable tutorial style books at major bookstores. I think that will go much faster for you than waiting for answers here.

    I recommend C++ Programming in Easy Steps and C++ DeMystified: A Self-Teaching Guide. Start there and it will help you develop your sense of what more-advanced materials suit your interests, such as the books identified in a post on Resources for Beginners.

    - Dennis



  • Ben Andrews

    unsigned means it's only positive. long and int are the same thing, but different types in theory ( long should be bigger )



  • LuisNeto

    Thanks for answering my first question. I edited it with another question.

  • Im confused about this.