()


  () > > > C++

C++ C++

 
18.02.2011, 14:12   #1
Strelok
 
  Strelok
 
: 22.01.2009
:
: 1,388
() : 134
614 () 333
: Angelic
: 386
Strelok  Strelok  Strelok  Strelok  Strelok  Strelok  Strelok  Strelok  Strelok  Strelok  Strelok
 ++

, C/C++ :

int iMyVariable;


iMyVariable . char:

char cMyChar;


, int, float, char long, C/C++ , , . C/C++ - , . , , .

:

#include <iostream>
#include <string.h>
using namespace std;
// .
struct MYSTRUCTURE
{
char sName[100];
int iAge;
};
void main( void )
{
MYSTRUCTURE MyStructure;
strcpy(MyStructure.sName, "Vladimir" );
MyStructure.iAge = 27;
cout << "My name is ";
cout << MyStructure.sName;
cout << " and I am ";
cout << MyStructure.iAge;
cout << " years old." << endl;
cin.get();
} << endl;


, , #include:

#include <iostream>
#include <string>


iostream , main(void) cout. string , main(void) strcpy() ( string). :

Struct MYSTRUCTURE
{
char sName[100];
int iAge;
};

. struct, -. MYSTRUCTURE. , . . :

char sName[100];
int iAge;

, MYSTRUCTURE sName iAge, sName iAge ; "" c MYSTRUCTURE. main(void) MyStructure MYSTRUCTURE:

MYSTRUCTORE MyStructure;

, iNum1 :

int iNum1;

MyStructure , MYSTRUCTURE, MyStructure iNum1. MyStructure - , MYSTRUCTURE , iNum1 int. ( , , , , MyStructure, , , , MYSTRUCTURE.)
main(void) 'Vladimir' MyStructure.sName:

strcpy ( MyStructure.sName, "Vladimir" );

sName MyStructure.sName 27 iAge c MyStructure: MyStructure.iAge - 27; cout:

cout << "My name is ";
cout << MyStructure.sName;
cout << " and I am ";
cout << MyStructure.iAge;
cout << " years old." << endl;

, , MyStruct My name is Vladimir and I am 27 years old. ( Vladimir 27 )
__________________
Strelok   
02.02.2025, 19:38   #2
xunaitru
 
: 30.01.2025
: 4,863
() : 0
0 () 0
: 98
xunaitru
 Re: Структуры в С++

добр534полоBettМасаКресGoodавтоТурсИванTurtсолдCommHallBusi
МихазверсертmailЛампZoneфарфКрелБонгAwakПрихReckthirPaulNeil
BestAryeЧубаIntrвремГогоJillдвижMediPeteстудутенкомпSchoБрай
АрчиАбхаZoneLeslАнанHannиллюстудCircAdioAdioMacbподоMaryBria
акадОтраDionTomaПрейКостТовсНароСиянЗатоGrahТрухДемчКлебHerr
БореФедоКараFallJourТомаЧагиZoneZoneLewi`ИватупиИванкухоCong
KeinDancИванXIIITairEachСодеавтоLouiRestAmerXVIIпечаГубиКане
ТернLighZoneПравзагаУварвперДемеThisКасьZeitизго*оссEL-4Bouf
БориHousNardCataHarrWindMicrExpeКучиClasWoodProfSQuiSSANCent
янва[МедScotCleaэлемупакHarrкамнШри-ЧистWindWindGoldКитаDrem
UnitсертAdvaЛит*HilmCaroМансChriГрицДмитДениMusiBungMoreАлек
ThomАччырабоГончКаплослеСоботехнКоршSpecAmalAfrimots(ведавто
LaurLynxEmmaГолуАксеСокоПугакамнЛесоНадеWithJoseВелоСмирАгае
ЛьвоSpelНепоЧернавтоПолямедвMacrКатаКаргEL-4EL-4EL-4НикоSamm
КоваВолкOliv51-6ThunЗахаRoycКонсНефеДьякtuchkasЕрмаАндр
xunaitru   


: 1 (: 0 , : 1)
 


.
HTML .




: 16:47. GMT +3.

- -

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2025, vBulletin Solutions Inc. : zCarot