7Priest7
May 24 2007, 04:24 PM
I did this code for a reason... It was a school project... I could not find this info anywhere... Maybe it will be use to some1 else.  CODE #include <iostream> #include <vector> #include <string> using namespace std;
int main() { int count=0; vector<string> Names(2); Names[0]="Alexa"; Names[1]="Alexc"; Names[2]="Alexb";
cout << "Before\n\n"; while(count<=2) { cout<<Names[count]<<'\n'; count++; } int i,j; int min;
for(i=0;i< 3 - 1;i++) { min = i;
for (j = i + 1; j<3;j++) { if (Names[j] < Names[min]){min=j;}} Names[i].swap(Names[min]); } count=0; cout << "\nAfter\n\n"; while(count<=2) { cout<<Names[count]<<'\n'; count++; } return 0; }
Reply
Similar Topics
Keywords : sorting, string, vector
- String Theory
(9)
Strange Ascii Code 22 Character Detected In Connection String
(9) Warning: Unexpected character in input: '' (ASCII=22) state=1 in
/usr/local/cpanel/cgi-sys/php4 on line 928 Parse error: syntax error, unexpected T_STRING in
/usr/local/cpanel/cgi-sys/php4 on line 928 i get that when i get on to my site:
http://eggie.sphosting.com how to solve it?....
Vector Linux
Looks cool, anyone use(d) it? (5) well last year i was downloading vector linux and gave up on it cos i only had dial-up. but i
remembered about it a while ago and the new version looks so cool! i wanted to know if anyone
out there has used it before and tell me what its like! i might download it tomorrow. ill
probably get the SOHO (small office/home office) edition, it has a better design! they are
currently in version 5.8. so basically, anyone used it before? whats your opinion and should i try
and install it on my old hard drive and get rid of centOS? my old hard drive is picky, all i can ....
Hearts Vector Wallpaper
(0) Another one of my vector wallpapers, for that love theme for you to share with your love ones across
the computer world. enjoy. ....
Check For Occurence Of Substring In String
(3) Hi, I've been working on a personal messenger, and one of the main problems I'm having is
that if there are 10 or so replies to a message, you end up with a subject like this: Re: Re: Re:
Re: Re: Re: Re: ..... etc. you get the picture Is there a function on PHP to check for an occurence
of a substring in a string? So I could check if the subject already has a "Re: " in it? It would be
really helpful, thanks!....
Php Any Variable In String.
(1) OK well I am making a new php program and I am trying to add bbcode to it. Anyway I was going to
replace each thing by it self, but that could cause errors. Anyway is there a way to make a variable
be anything? Here is an example: CODE This is the bbcode:
[color=00FF00]Hey[/color] In my php: $bbcode =
array("[color=".$a."]"); $html = array( "<font
color='#".$a."'>"); $topic_content =
str_replace($bbcode, $html, $posted_bbcode)....
City By Night Vector Tutorial
(0) City at Night Tutorial This tutorial is based on the wallpaper I design, you will need the
following brushes to accomplish this tutorial or other designs like it. As note that a lot of
layers will be moved around during the course of this tutorial and I will let you know as such.
Download brushes here Small note on the brushes I did not create them I am justing packaging
them so people don't have to spend hours looking for them. Step 1: Open up a new document
and since we are going for a desktop wallpaper the size will be 1024x768. Now select t....
City By The Night Vector Wallpaper
(7) I like to present my first legit Vector design, after downloading enough vector brushes to keep me
happy I thought I try my luck and see what I could design. I designed it at 1024x768 and it looks
halfway descent as a desktop wallpaper, so questions and comments. ....
Help Spliting A String Into 3 Variables In C++
I have searched on the net but havent found much help (2) Hi there im new around here ^^, my original language is spanish so sorry for any wrong word i
use,... Im working on some features for my program to load a Favorite games list from a text file
but the problem I have is not parsing the file, is processing a string and spliting it into 3
variables, then I will use them to insert as items in a List View control, I just dont know what is
wrong in the following code... CODE
//------------------------------------------------------------ TCHAR* pszRomname =
NULL; TCHAR* pszTitle= NULL; TCHAR* p....
How To Remove Query String Using Regular Expressions
(4) Hi, I'm a complete newbie using regular expressions and what i want to do is to remove all the
parameters of the query string of any url using regular expressions, how can i do this? For example
if i have some urls like these: http://www.domain.com/file1.php?var1=value1&var2=value2
http://www.domain.com/file2.php?var1=value1&var2=value2
http://www.domain.com/file3.php?var1=value1&var2=value2 I want to only get these ones:
http://www.domain.com/file1.php http://www.domain.com/file2.php http://www.domain.com/file3.php
If it is possible please post no....
Php String To Int Typecasting
(5) I've been working on writing this program that needs strings to be converted to integers.
Sometimes PHP works by doing the converting for me, but sometimes it just breaks down and quits
working. I've got no idea why. $sub1 = 0+substr($text, 0, 3); $sub2 =
0+substr($text, 3, 6); $sub3 = 0+substr($text, 6, 9); $sum =
0+$sub1+$sub2+$sub3; echo $sum; Basically, $text is a string of numbers
that looks something like: 296294255268313 and so on. Then I use substr to get the first three
digits/letters of ....
Sorting
How to sort data in arrays- examples given in Java (0) Sorting- Using Java Language First of all, why the heck should I care about sorting? Easier
to present data- it is very frustrating to be looking for some information and it is not in order
Faster searching algorithms- most searching algorithms require looking at every element in a list
until the requested one is found, but if it is sorted, you can use binary search (I'll explain
in another tutorial) to drastically cut search time Less memory for searching- there ARE ways to
increase search time in unsorted lists (with indexing and such), but these take mu....
Story Teller
A vector artwork (10) One of my blog-team is writing an article on storytelling/narration . This is a vector art quicky
I did for the illustration of the blog post: Edit: Link to the article updated.....
Geese Formation
Vector art illustration for blog article (9) Here is one more of a vector art illustration that I created just now for a future blog post of
mine. After looking at few geese photos from Google Image search, I came up with this concept and
drew it. It took me about an hour using Inkscape to do the above illustration. /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />....
"Command Prompt"
A vector image for a blog article (5) /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Well, that
is a enlarged view of a vector illustration I made for another blog post I will be writing soon.
Nothing breath taking - I know - it is just a 5-10 minute doodle I did in Inkscape and it seemed to
have come out ok. Thought of showing it to you guys here.....
"Orphan Work" And "Designing"
Some more vector art (5) Boy... am I getting addicted to this or what? Like my earlier work, these two illustrations I
created in Inkscape for the coming blog posts at my blog. This is for a blog post on the Orphan
Work Act of 2006 blog post, that I will be able to post by next week. This one is for a series of
design articles that I intend to write about. /smile.gif" style="vertical-align:middle" emoid=":)"
border="0" alt="smile.gif" />....
Ant And Larvae
Vector Art for a blog article (6) Well, here is another one of vector art that I created. It took roughly 2 hours from concept to
final stage in Inkscape. My friend who is in the team of authors for my blog has written an
extensive write-up on a nature related topic that dealt with parasatic blue butterflies (their
larvae), ants and wasps. I was pretty impressed by the write up and thought I should make a image
to accompany with it. So, I started doodling with stuff and got the concept. Then I fired up the
Inkscape and this is what I have: I attempted an caricature-cartoon like feel and also wan....
Face Of A Friend
A vector artwork to gift a friend (45) Here is a work in progress I would like to share it with Astahosters. Lately, a friend of mine
joined my blogging team at Splat . She had been of great help even before when I was working on my
website WiseTome.com though she just joined Splat. To show my appreciation, I thought I would
gift her an artwork. And with this, I hope to improve my skills too. So, here goes. It is
still a work in progress . I used her photograph as a reference and worked on it from scratch in
Inkscape. The basic outline with flat colors is done, and I have just started to work o....
Bearded Man
Vector Art quicky (6) I wanted to create a quick vector art for a blog post of mine. I sought inspiration from a World Of
Warcraft wallpaper, and created this in about 1 hour using Inkscape. It turned out pretty good. It
is not a polished work but I would be using it in the same format for my blog article on Vector Art.
Comment and critique please. /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
alt="smile.gif" />....
10 Step Tutorial To Create Shiny Ball Vector Art
and two other vector artworks (0) A week back or so, I happened to stumble across Inkscape (http://inkscape.org) and I was hooked. In
a few days, I was able to create some things that were recognizable, and I created two clip arts at
my blog as give aways: Red Ornament Dreidel And after that, I went ahead to create a
tutorial that explains the basic steps and concept of vector art - as I have learned. I put that
too on my blog, and can be found at the following permanent link: 10 step tutorial to create shiny
ball vector art Please give your comments and critique. /smile.gif" style=....
Using Leading Zeros And Sorting Data
Sort data correctly (2) The Importance Of Using Leading Zeros Leading zeros are a very important tool for
sorting and comparing data on computers. What is a leading zero? A leading zero does just what it
sounds like, it leads the value. For example, lets convert a few numbers to leading zero numbers to
make the new number 5 digits long. 234 => 00234 456 => 00456 6456 => 06456 12 => 00012 4 => 00004
677 => 00677 That's great right but why would you do that? This is done for 2 reasons
actually. The first is to display numbers in a more uniform and easier to read form....
VBScript: Help, Looping Through Registry Keys
not sure exactly how to loop through subkeys till i find a string. (1) I have been assigning nic speeds for a couple years on all new boxes that we build in our
datacenters manually. I finally got fed up and picked up some vbscript books which have been a great
help managing some redunant tasks i must do, but this one stumps me. Key Name:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11
CE-BFC1-08002bE10318} Under each subkey there is a string value of "SpeedDuplex" with a value
ranging from 0+ 100/full is 4 auto/auto is 0 If the device is not a physical hardware nic, it will
not have th....
Sorting In Treeview
(2) Hi, I have a TreeView created that allows users to add new Nodes into it. How can it be coded so
that it allows the user to sort it, or better yet, auto-sort it each time it loads (and whenever a
user adds/deletes a node)? Can this be done on a the child nodes under the parent also? For
example: Main/Root Node Parent (sub root node) Child Nodes ...maybe more child nodes So it sorts
in the deeper levels accordingly also. Using Visual Basic 6. Thanks.....
PHP And Texts: Need Help With PHP String Functions
(5) Hey people! I'm pretty new with PHP and MySQL. I wanna have all the text on my site in
MySQL. But i'm having trouble with the inputing from HTML-forms, like . How to i do it? Can i
use PHP or is it better to use javascript and sorta add htmltags into the tag? I wanna make a
texteditor where i can use bold, italic and that kinda stuff. I'm thankful for any help...
/Jens....
Multibyte-string Functions
since server shift (1) Hello, I use multibyte functions to split a string by letter and I was wondering if you could turn
them on again, because they were on before the server shift (and they are in PHP by default) and now
I get fatal errors, when trying to use them. In the Phpinfo they don't appear at all.. I've
been waiting for quite some time now and it is only a basic PHP-integrated feature.. Thanks, Ruben....
Vector Sigs
Rate and Comment - 56k Warning :) (18) Hey guys i have certainly taken a liking to vector style sigs and have combined a few of my other
sig techniques to move away from the traditional full vector renders (the pics usually people) and
use just the vector backgrounds. I would like you to comment and rate them please. As you can see
they are mostly to my taste(bands and movies) and then gifts. The right Neo in the Matrix sig is a
full vector /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' />
....
A Piece Of My Work
vector (6) opinions are welcome /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> ....
Question: Vector Based Animation?
Free flash like programs... (4) Hello there! I have experience in flash through art classes in school, and Being a 16 year old
on a low budget, I was curious if there were any flash like programs out there for free? I know free
is pushing it lol... but Im desperate and my creative imagination needs to be released. I'm just
looking for something that has the basic feel and capabilities of flash. Im looking for something
that will be vector based, will animate, and will allow sounds to be added into the background!
Any information would be awesomely appreciated! Thanks much!....
Sorting A List
Algorithem Search (14) Okay, I'm not looking for code here, just the steps the algorithem would go through. I am
trying to find the fastest algorithem to sort a list of elements. So far the fastest I have come up
with is as follows (demonstrated on a five element list). Step List Procedure 0
dbace this is the starting list 1 bdace compare spots 1 and 2,
switch if necessary 2 bdace compare spots 5 and 4, switch if necessary 3
adbce compare spots 1 and 3, switch if necessary 4 adbce c....
Array Sorting
Does anyone hava a decent JAVA method (21) does anyone have a decent JAVA method that will sort an array from smallest-to highest?
/mellow.gif" style="vertical-align:middle" emoid=":mellow:" border="0" alt="mellow.gif" /> The one
i'm trying to write doesn't seem to work... or if you could look at mine below, and tell me
what i did wrong, that'd be nice to.(if it reallllyyyyyyyyy sucks, please dont laugh to loud
/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> ) This should
take an array and then calculate how many of a number is in it, add it to the first slots....
Looking for sorting, string, vector
|
|
Searching Video's for sorting, string, vector
|
advertisement
|
|