در خدمت شما دوستان عزیر هستیم با آموزش برنامه نویسی Go – انواع داده در برنامه نویسی GO از وب سایت آموزشی سورس باران. در این جلسه با انواع داده در برنامه نویسی GO آشنا خواهید شد.
انواع داده در برنامه نویسی GO
در زبان Go نوع داده ها به سیستم وسیعی که برای مقدار دهی متغیر ها یا توابع به کار میرود مربوط میشود.نوع یک متغیر معلوم میکند که چقدر حافظه را اشغال شود والگوی آن چگونه کامپایل شود. انواع متغیر ها در این زبان عبارتند از:
متغیر Boolean Type در برنامه نویسی GO
اینها متغیرهای منطقی هستند که شامل دو مقدار a برای true و b برای false هست.
متغیر numeric type در برنامه نویسی GO
این متغیرهای ریاضی هستند که اعداد صحیح را با a و اعداد اعشاری را با b نشان میدهند.
متغیر String Types در برنامه نویسی GO
نوع داده رشته ای مجموعه ای از مقادیر رشته ای را نشان می دهند. که مجموعه از بابیت ها هستند و همچنین تغییر ناپذیر هستند.
توابع آرایه ای و ساختاری به انواع مجموعه ای مربوط هستندو نوع یک تابع مجموعه تمام توابع را با همان پارامتر های آن را تعیین میکند.ما انواع داده پایه را در بخش زیر میبینیم بقیه آنها در قسمت های بعد پرداخته خواهدشد.
نوع داده های صحیح در برنامه نویسی GO
نوع داده های صحیح از پیش تعریف شده عبارتند از
انواع داده های عددی دیگرهمچنین یک مجموعه از نوع داده عددی با سایز های مخصوص طراحی شده اند
In the Go programming language, data types refer to an extensive system used for declaring variables or functions of different types. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted.
The types in Go can be classified as follows −
Sr.No. | Types and Description |
---|---|
1 | Boolean types They are boolean types and consists of the two predefined constants: (a) true (b) false |
2 | Numeric types They are again arithmetic types and they represents a) integer types or b) floating point values throughout the program. |
3 | String types A string type represents the set of string values. Its value is a sequence of bytes. Strings are immutable types that is once created, it is not possible to change the contents of a string. The predeclared string type is string. |
4 | Derived types They include (a) Pointer types, (b) Array types, (c) Structure types, (d) Union types and (e) Function types f) Slice types g) Interface types h) Map types i) Channel Types |
Array types and structure types are collectively referred to as aggregate types. The type of a function specifies the set of all functions with the same parameter and result types. We will discuss the basic types in the following section, whereas other types will be covered in the upcoming chapters.
Integer Types
The predefined architecture-independent integer types are −
Sr.No. | Types and Description |
---|---|
1 | uint8 Unsigned 8-bit integers (0 to 255) |
2 | uint16 Unsigned 16-bit integers (0 to 65535) |
3 | uint32 Unsigned 32-bit integers (0 to 4294967295) |
4 | uint64 Unsigned 64-bit integers (0 to 18446744073709551615) |
5 | int8 Signed 8-bit integers (-128 to 127) |
6 | int16 Signed 16-bit integers (-32768 to 32767) |
7 | int32 Signed 32-bit integers (-2147483648 to 2147483647) |
8 | int64 Signed 64-bit integers (-9223372036854775808 to 9223372036854775807) |
Floating Types
The predefined architecture-independent float types are −
Sr.No. | Types and Description |
---|---|
1 | float32 IEEE-754 32-bit floating-point numbers |
2 | float64 IEEE-754 64-bit floating-point numbers |
3 | complex64 Complex numbers with float32 real and imaginary parts |
4 | complex128 Complex numbers with float64 real and imaginary parts |
The value of an n-bit integer is n bits and is represented using two’s complement arithmetic operations.
Other Numeric Types
There is also a set of numeric types with implementation-specific sizes −
Sr.No. | Types and Description |
---|---|
1 | byte same as uint8 |
2 | rune same as int32 |
3 | uint 32 or 64 bits |
4 | int same size as uint |
5 | uintptr an unsigned integer to store the uninterpreted bits of a pointer value |
لیست مطالب جلسه قبل برنامه نویسی Go
راستی! برای دریافت مطالب جدید در کانال تلگرام یا پیج اینستاگرام سورس باران عضو شوید.
- منبع : سورس باران
- رمز فايل : www.sourcebaran.com
- انتشار: ۲۷ مرداد ۱۳۹۷
دسته بندی موضوعات
- آموزش برنامه نویسی
- آموزش کریپتو کارنسی (ارز دیجیتال)
- آموزش متنی برنامه نویسی
- پروژه برنامه نویسی
- فروشگاه
- فیلم های آموزشی
- #F
- ++C
- 3ds max
- Ada
- ADO.NET
- Adobe Flash
- Agile
- Ajax
- AngularJS
- Anime Studio
- apache
- ARM
- Asp.Net
- ASP.NET MVC
- assembly
- AVR
- Azure
- Bootstrap
- Cassandra
- CCNA
- CCNP
- CCSP
- ChatGPT
- Cisco
- CMD
- COBOL
- CSS
- Cython
- Django
- Dreameaver
- Elixir
- EntityFramework
- Erlang
- Flash
- Go
- Groovy
- Haskell
- Htaccess
- HTML
- IOS
- Jade
- jquery
- Kendo UI
- Linq
- Linux
- LUA
- MariaDB
- maya
- Meteor
- MongoDB
- Mono Android
- MonoGame
- Mysql
- NoSQL
- Oracle
- Orchard
- Perl
- php
- PHPMyAdmin
- R
- Rational Rose
- Ruby
- Rust
- Scala
- Scrum Master
- SFML
- SharePoint
- SignalR
- silver light
- SQL Server
- Stimulsoft Reports
- Telerik
- UML
- VB.NET&VB6
- Vue 3
- WPF
- Xml
- آردوینو
- آموزش های پروژه محور
- آیونیک
- اتوکد
- الگوریتم تقریبی
- الگوریتم نویسی و فلوچارت
- امنیت
- اندروید
- اندروید استودیو
- انیمیشن سازی
- بازی سازی با Scratch
- بک ترک
- بیسیک فور اندروید
- پایتون
- پرولوگ
- پریمیر
- جاوا
- جاوا اسکریپت
- جنگو
- جوملا
- دارت
- دلفی
- دوره های رایگان پیشنهادی
- زامارین
- سئو
- ساخت CMS
- ساخت اتوران
- ساختمان داده ها
- سی شارپ
- شبکه و مجازی سازی
- طراحی الگوریتم
- طراحی بازی
- طراحی وب
- فتوشاپ
- فریم ورک codeigniter
- فلاتر
- کاتلین
- کامپایلرها
- کانستراکت
- کریستال ریپورت
- کلوژر
- گوگل آنالیتیکس
- گیت
- لاراول
- مای بی بی
- مایکروسافت پروجکت
- متریال دیزاین
- متلب
- معماری کامپیوتر
- مهندسی اینترنت
- میکروتیک
- نود جی اس
- نیوک
- هوش مصنوعی
- ویبولوتین
- ویژوال استودیو
- یونیتی
- کتاب های آموزشی
- Ada
- Ajax
- Android
- ASP.NET
- ASP.NET Core
- AVR
- clips
- CNC
- COBOL
- CQRS
- Cython
- Dreamweaver
- Elixir
- Entity Framework 4.0
- Erlang
- Go
- Groovy
- Haskell
- LINQ
- Lua
- Matlab
- MFC
- Node.js
- PERL
- php
- PLC
- Prolog
- React
- Rust
- Scala
- SFML
- SharePoint
- silver light
- VHDL
- VMware
- WinJS
- Workflow
- WPF
- XHTML
- Yii Framework
- اتوکد
- اچ تی ام ال
- اسمبلی
- اکتیو ایکس
- الگوریتم و فلوچارت
- انگولار
- اوبونتو
- اوراکل
- بازی سازی
- بانک اطلاعاتی
- برنامه نویسی سوکت
- برنامه نویسی موبایل
- بک ترک
- پاسکال
- پایان نامه
- پایتون
- پرولوگ
- جاوا
- جاوا اسکریپت
- جی کوئری
- حوملا
- داده کاوی
- دلفی
- رباتیک
- روبی
- زبان ماشین
- سئو
- ساختمان داده ها
- سایر کتاب ها
- سخت افزار
- سوئیفت
- سی اس اس
- سی پلاس پلاس
- سی شارپ
- سیستم عامل
- سیستم های خبره
- شبکه و مجازی سازی
- شبیه سازی کامپیوتر
- طراحی الگوریتم
- فتوشاپ
- فریم ورک گتنا
- کاتلین
- کالی لینوکس
- کریستال ریپورت
- گزارش کارآموزی
- گوگل
- لیسپ
- متلب
- مقاله
- مهندسی نرم افزار
- نیوک
- هوش مصنوعی
- وب مستر
- ویژوال بیسیک
- نرم افزار و ابزار برنامه نویسی
- وردپرس