Thread: Data type

  1. #1
    Banned
    Join Date
    Apr 2015
    Posts
    596

    Data type

    Hi guys! what's up?
    I know what's datatype and what it means, but it's curious for me why I can write simultaneously like this int x=5 , isn't "int" considered as variable on the programming language? I mean if I write int x y=5 then my compiler will warn me up ; but when I write int x=5 it wouldn't warn me up ..why? I mean why my compiler isn't consider "int" as variable?! is that language definition and I can't change what's already defined? I mean I should learn what the language provides and not follow "my language" what it tells me ...


    thanks alot

  2. #2
    Banned
    Join Date
    Apr 2015
    Posts
    596
    I mean how should I look as a programmer on the data type ?!

  3. #3
    Registered User
    Join Date
    Dec 2017
    Posts
    694
    You are truly an idiot.
    The world hangs on a thin thread, and that is the psyche of man. - Carl Jung

  4. #4
    Registered User
    Join Date
    Feb 2019
    Posts
    550
    Quote Originally Posted by RyanC View Post
    I know what's datatype and what it means, but it's curious for me why I can write simultaneously like this int x=5 , isn't "int" considered as variable on the programming language?
    So, what you saying is that you know, but don't know (at the same time) what a 'data type' is?

    Quote Originally Posted by RyanC View Post
    I mean if I write int x y=5 then my compiler will warn me up ; but when I write int x=5 it wouldn't warn me up ..why?
    Syntax error?

    Quote Originally Posted by RyanC View Post
    I mean why my compiler isn't consider "int" as variable?!
    Because it isn't a variable but a type?

    Quote Originally Posted by RyanC View Post
    is that language definition and I can't change what's already defined? I mean I should learn what the language provides and not follow "my language" what it tells me ...
    Did you ever read about "reserved words"? By the way, there is no such thing as "your language". Every language follows certain rules (called grammar). It is usual, for instance, to use punctuation in a well defined way to convey information to the reader. And every word has meaning. The difference is context - in a "real" language (in opposition to "computer languages"), sometimes is ok to break the rules (not always!), but this isn't the case for formal languages which compilers expect to find.

  5. #5
    Banned
    Join Date
    Apr 2015
    Posts
    596
    Quote Originally Posted by flp1969 View Post
    So, what you saying is that you know, but don't know (at the same time) what a 'data type' is?

    Syntax error?

    Because it isn't a variable but a type?

    Did you ever read about "reserved words"? By the way, there is no such thing as "your language". Every language follows certain rules (called grammar). It is usual, for instance, to use punctuation in a well defined way to convey information to the reader. And every word has meaning. The difference is context - in a "real" language (in opposition to "computer languages"), sometimes is ok to break the rules (not always!), but this isn't the case for formal languages which compilers expect to find.
    got the idea .. thanks !

  6. #6
    Registered User
    Join Date
    May 2016
    Posts
    104
    Quote Originally Posted by flp1969 View Post
    So, what you saying is that you know, but don't know (at the same time) what a 'data type' is?
    Dammit! you made me spill my coffee.
    ---
    Ryanc, you are truly an inspiration. Every time I look at your posts I think to myself, I can do this. You give me hope. Thank you.
    printf("I'm a %s.\n", strrev("Dren"));

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 17
    Last Post: 08-05-2018, 06:59 PM
  2. Data type ?!!
    By abood1190 in forum C Programming
    Replies: 8
    Last Post: 11-02-2011, 12:59 AM
  3. Replies: 2
    Last Post: 05-14-2011, 09:26 PM
  4. store string data as a short or other data type
    By robin2aj in forum C Programming
    Replies: 5
    Last Post: 04-07-2010, 11:02 AM
  5. new data type
    By jackson in forum C++ Programming
    Replies: 4
    Last Post: 01-04-2003, 02:32 AM

Tags for this Thread