PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > Vectors vs arrays
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Vectors vs arrays

Réponse
 
LinkBack Outils de la discussion
Vieux 15/04/2008, 09h27   #1
jacox
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Vectors vs arrays

what's the difference between vectors and arrays in C?
I only knew array, as data structure, and not vector!
When must i use vector and when array?

Thanks

--

questo articolo e` stato inviato via web dal servizio gratuito
http://www.newsland.it/news segnala gli abusi ad abuse@newsland.it


  Réponse avec citation
Vieux 15/04/2008, 09h33   #2
Richard Heathfield
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Vectors vs arrays

jacox said:

> what's the difference between vectors and arrays in C?


Arrays exist.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
  Réponse avec citation
Vieux 15/04/2008, 10h59   #3
Nick Keighley
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Vectors vs arrays

On 15 Apr, 09:27, jacopo...@yahoo.it (jacox) wrote:

> what's the difference between vectors and arrays in C?
> I only knew array, as data structure, and not vector!
> When must i use vector and when array?


There are no "vectors" in C. There are in C++.
Try a C++ news group if you are interested in the
C++ answer.

--
Nick Keighley
  Réponse avec citation
Vieux 15/04/2008, 11h37   #4
arnuld
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Vectors vs arrays

> On Tue, 15 Apr 2008 08:33:11 +0000, Richard Heathfield wrote:

>> jacox said:
>> what's the difference between vectors and arrays in C?


> Arrays exist.M






--
http://lispmachine.wordpress.com/


  Réponse avec citation
Vieux 15/04/2008, 18h00   #5
Antoninus Twink
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Vectors vs arrays

On 15 Apr 2008 at 8:27, jacox wrote:
> what's the difference between vectors and arrays in C?
> I only knew array, as data structure, and not vector!
> When must i use vector and when array?


In C++, a vector is an array with some additional functionality. One of
the main advantages is that vectors support bounds checking: if you use
the at() method, the access will be bounds-checked and throw an
exception if the element does not exist. (You can also avoid bounds
checking by using [], which is overloaded.)

A vector will also grow dynamically as needed when you add elements to
it: an array's size is fixed once and for all when you define it.

  Réponse avec citation
Vieux 15/04/2008, 19h54   #6
Dann Corbit
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Vectors vs arrays

"jacox" <jacopoxxx@yahoo.it> wrote in message
news:fu1ot6$mdg$1@news.newsland.it...
> what's the difference between vectors and arrays in C?


In C++, there is a separate type of vector defined in the C++ standard.

> I only knew array, as data structure, and not vector!


"My foot was glued, like lead to the floor. That's all there is, and there
ain't no more."
-- "Hot Rod Lincoln"

> When must i use vector and when array?


In C, you just use arrays.


** Posted from http://www.teranews.com **
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 21h26.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10296 seconds with 14 queries