O documento descreve como criar e populat arrays (vetores) em C#. Explica que arrays são declarados usando tipo[] nome e instanciados com new tipo[tamanho]. Demonstra como atribuir valores aos índices do array e percorrer o array usando for e foreach para exibir os valores.
E-waste is a term used to cover almost all types of electrical and electronic equipment (EEE) that has or could enter the waste stream. Although e-waste is a general term, it can be considered to cover TVs, computers, mobile phones, white goods (e.g. fridges, washing machines, dryers etc), home entertainment and stereo systems, toys, toasters, kettles – almost any household or business item with circuitry or electrical components with power or battery supply.
AN ENTRANCE PREPARATION STUDIO FOR ARCHITECTURE , DESIGN AND ART CAREERS.
ENTRANCE COACHING STUDIO FOR B.ARCH ( NATA / JEE ) ,
NID ,IIT CEED , PEARL, SRISHTI , SYMBIOSIS ETC..
PORTFOLIO PREPARATION FOR ARCHITECTURE AND DESIGN STUDIES ABROAD
E-waste is a term used to cover almost all types of electrical and electronic equipment (EEE) that has or could enter the waste stream. Although e-waste is a general term, it can be considered to cover TVs, computers, mobile phones, white goods (e.g. fridges, washing machines, dryers etc), home entertainment and stereo systems, toys, toasters, kettles – almost any household or business item with circuitry or electrical components with power or battery supply.
AN ENTRANCE PREPARATION STUDIO FOR ARCHITECTURE , DESIGN AND ART CAREERS.
ENTRANCE COACHING STUDIO FOR B.ARCH ( NATA / JEE ) ,
NID ,IIT CEED , PEARL, SRISHTI , SYMBIOSIS ETC..
PORTFOLIO PREPARATION FOR ARCHITECTURE AND DESIGN STUDIES ABROAD
Slide da Palestra Web Design Hacker ministrada na semana acadêmica/flisol Porto Alegre 2015 na faculdade Alcides Maya Tecnologia.
Esta apresentação é feita exclusivamente com software livre, Gimp, Inkscape, LibreOffice, Ubuntu
2. Array (vetor)Array (vetor)
Criando ArraysCriando Arrays
A sintaxe básica de um Array é:A sintaxe básica de um Array é:
tipo[ ] nome;tipo[ ] nome;
nome = new tipo [tamanho];nome = new tipo [tamanho];
ouou
Tipo[ ] nome = new tipo [tamanho];Tipo[ ] nome = new tipo [tamanho];
3. Array (vetor)Array (vetor)
Exemplos:Exemplos:
Int32[] vetorNumeros;Int32[] vetorNumeros;
vetorNumeros = new Int32 [10];vetorNumeros = new Int32 [10];
String[] vetorNomes = new String [10];String[] vetorNomes = new String [10];
4. Array (vetor)Array (vetor)
Agregar valores no ArrayAgregar valores no Array
String[] vetorNomes = new String [10];String[] vetorNomes = new String [10];
VetorNomes[0] = “José”;VetorNomes[0] = “José”;
VetorNomes[1] = “Luiz”;VetorNomes[1] = “Luiz”;
VetorNomes[2] = “Hugo”;VetorNomes[2] = “Hugo”;
……
5. Array (vetor)Array (vetor)
Agregar valores no ArrayAgregar valores no Array
String[] vetorNomes = new String [10];String[] vetorNomes = new String [10];
For (i=0; i<= 9; i++)For (i=0; i<= 9; i++)
{{
VetorNomes[i] = Console.ReadLine();VetorNomes[i] = Console.ReadLine();
}}
6. Array (vetor)Array (vetor)
Agregar valores no ArrayAgregar valores no Array
String[] vetorNomes = new String [10];String[] vetorNomes = new String [10];
Foreach (string pessoa in vetorNomes)Foreach (string pessoa in vetorNomes)
{{
Console.WriteLine(pessoa);Console.WriteLine(pessoa);
}}
7. Array (vetor)Array (vetor)
Agregar valores no ArrayAgregar valores no Array
String[] vetorNomes = new String [10];String[] vetorNomes = new String [10];
Foreach (string pessoa in vetorNomes)Foreach (string pessoa in vetorNomes)
{{
Console.WriteLine(pessoa);Console.WriteLine(pessoa);
}}