i have visual studio 6.0 if i buy c++ will it run with this and is there lots of people using it like vb6?
thanks
Printable View
i have visual studio 6.0 if i buy c++ will it run with this and is there lots of people using it like vb6?
thanks
VS6.0 is a suite that contains several language in series like, VB6, VC++6, VF6, etc... Why do you need to buy it separate ?
If you are moving to .Net, then try Visual Studio 2010. Or get the free Express versions of the languages from Microsoft's site.
Or, if you are a student, you might get the free Pro versions of these languages via DreamSpark initiative of Microsoft.
:wave:
I believe the OP wants to work with VHD files (virtual hard drives).
never paid attention to the others time to start
ive been googling alot on how to make /create an vhd file ,what exactly do i look under to find more info?
thanks
Just curious - you aren't trying to break into a VHD file - are you?
nope.
just strickly making one my self,i know theres tons of programs out there to do this ,i have some of them,just something i do to learn how it works and i like to do it myself , at least as much as i can...
I searched up
VHD FILE FORMAT
This looks like a good link - with more links at the bottom
http://www.enotes.com/topic/VHD_(file_format)
hey msdn says the api for Virtual Hard Disk have to be running win 7 can it still be used in win xp?
hi
what does (cin) stand for?
how do i put my name and age in without having to prompt the user?
thanks
Code:// prompt user to enter the new info
cout << "Set database info...\n";
cout << "Name: ";
cin.getline(per.name, 8);
cout << "Age: ";
(cin >> per.age).get();// add the .get() to clear the newline character
cout << "Salary: ";
(cin >> per.salary).get();// note .getline() clears its own newline character
// save the new user-entered data
if (SaveDB(&per))
cout << "\nDatabase saved!\n";
else
cout << "\nUnable to save database!\n";
// give the user a chance to look things over before quitting
cout << "\n[hit enter]";
cin.get();
// return 0 on success (main() should never be void!)
return 0;
cin is for input operations(to read user inputs) and cout is for output operations(displaying on the screen)
:wave:
Code:do i have to use (char) letters and (int) for numbers?
// the data that will go into the database
struct Person {
char name[40];
int age;
float salary;
};
char is the datatype for storing character. Inorder to store a string, you would use an array of characters(a string would contain a number of characters. So we are using array of char to store strings)
And int is to hold numbers within a specific range. It's of the range -32K to +32K I think. So you could store any values within that range in an int variable. Unsigned int would have a range of 0 to 64K. Just google it to know more.
:wave:
im getting an error at this line.
Person Per ;{
the error is
am i doing something wrongCode:error C2447: '{' : missing function header (old-style formal list?)
thanks
Code:#include <fstream> // for ifstream, ofstream, ios_base
#include <iostream>// for cin, cout, endl
// you can just say `using namespace std;` here instead of all these 'using's
using std::ios_base;
using std::cout;
using std::cin;
using std::endl;
// just creating a constant for the name of the database
static const char *DATABASE_FILE = "pr1.bin";
// the data that will go into the database
struct Person {
char name[8];
int Features;
int FFVersion;
int DataOffset;
int TimeStamp;
char CreatorApplication[4];
int CreatorVersion;
int CreatorHostOS;
int OriginalSize;
int CurrentSize;
int DiskGeometry;
int DiskType;
int Checksum;
int UniqueId;
int SavedState;
//int Reserved;
};
Person Per ;{
name = williamc;
Features = 0000;
FFVersion = 0100;
DataOffset = FFFFFFFF;
TimeStamp = 1000;
CreatorApplication = wmc ;
CreatorVersion = 0100;
CreatorHostOS = Wi2k;
OriginalSize = 5243392;
CurrentSize = 5243392;
DiskGeometry = 00065535;
DiskType = 0002;
Checksum = 0512;
UniqueId = 1234567812345678;
SavedState = 1;
}
// this function takes a pointer to a Person struct
// that will be filled with the data in the file
bool LoadDB(Person *per) {
// first parameter is the name of the file
// second is the open flags.
// `in` says you will read from the file
// `binary` says you will read binary data instead of simple text
std::ifstream fin(DATABASE_FILE, ios_base::in | ios_base::binary);
// if we couldn't open the file (it may not exist); fail
if (!fin.is_open())
return false;
// the file is open; tell the read function to look at `per` as a
// char pointer instead of a Person pointer so that `fin` can place
// one byte at a time into the struct
// the second parameter tells read() how many bytes to read
// Note: do not use the ">>" operator to read from a binary file
fin.read((char*)per, sizeof(Person));
fin.close();// close the file - not necessary, but we should be neat
// success
return true;
}
// this function takes a pointer to a Person struct
// that will be written into the file
bool SaveDB(Person *per) {
// these flags say:
// `out` - we will be writing data into the file
// `binary` - we will be writing binary data and not simple text
// `trunc` - if the file already exists, truncate (wipe out) the existing data
std::ofstream fout(DATABASE_FILE, ios_base::out | ios_base::binary | ios_base::trunc);
// couldn't open it (disk error?); fail
if (!fout.is_open())
return false;
// notice this time we cast the Person pointer to a const char* because we aren't
// altering the structure this time; rather we're just looking at it's contents.
fout.write((const char*)per, sizeof(Person));
fout.close();// close the file - not necessary, but we should be neat
// success
return true;
}
int main() {
// create an empty person struct
Person per;
// load the data in the db file
if (LoadDB(&per)) {
// print what we loaded into our Person struct
cout << "Loaded Database...\n";
cout << "Name = " << per.name << endl;
cout << endl;
}
// save the new user-entered data
if (SaveDB(&per))
cout << "\nDatabase saved!\n";
else
cout << "\nUnable to save database!\n";
system("pause");
// return 0 on success (main() should never be void!)
return 0;
}
This
Person Per ;{
should be this
Person Per {
I would believe...
nope tried that .
yall have a good mothers day
thanks all
Try accessing it's member's using the dot on the object.
Example:
:wave:c++ Code:
Person Per ; Per.name = "williamc"; Per.Features = 0000; Per.FFVersion = 0100; Per.DataOffset = FFFFFFFF; //...