which is faster (C++)

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

calculus87

Thread Starter
Joined
Sep 4, 2003
Messages
34
Okay,
my question is this. Which is faster on execution, and why?

1)storing data in a vector of strings
or
2) opening a file and storing the data in the file.

note: there is about 800 pages of data.
note: I will also be accessing the data several times in the program
 
Joined
Aug 8, 2003
Messages
307
When you have a huge amount of varibles, or a couple with huge range of arrays (i.e. char szArray[100000][100000]) the program is going to run alittle slower and might crash. This is because, as you probably already know, everytime you make a varible or an array C++ stores that information in a Hexidecimal value somewhere on your motherboard. For example, look at the szArray, it has 10,000,000,000 (10 BILLION) places for possible characters! So, if C++ (for example) stores the being character (szArray[0][0]) at 171, szArray[100000][10000] is going to be at 10,000,000,171! It is my opinion that you use a file to store the data and only use a couple varibles. This has a less chance of slowing down and crashing. But, you'll need to systematicly store all the information so you can then retrieve it with a formula easily.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top