ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i have a doubt in vector strings what are these vector strings.
and if this is a vector how to find the dimention of these vector or what
is the dimention of this vector.
Linked to above is not a C but a C++ vector reference. There really is no C-language vector (there are “arrays” which are contiguous memory areas holding a series of objects of a single type). Up until recently (C99), an array’s length was always determined at compile-time. Now an array’s length may be variable. Still, arrays are much different from vectors (for example, you can’t “grow” or “shrink” arrays).
You can implement your own vector functions in C using the memory allocation functions such as malloc(), calloc(), and realloc(). They will probably not be as type-generic as the C++ template-based stl vectors though (unless you are really creative with your preprocessing).
thanx osor,
but how will i implement vector function using memory functions melloc, calloc and realloc.
as there mast be some dimention of vectors so here in this case what will be the dimention
of vector after implementing it from malloc like functions.
and yes i m interested in c programming constructs.
There are 'C' modules that can be added, to service vector types or quite simply, arrays of arrays (variable length) for that is what a vector is anyway!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.