| Eclipse problem |
[29 Aug 2005|02:20pm] |
I'm currently going through a C refresher tutorial and using Eclipse 3.1 as my IDE. I want to create a project heirachy in Eclipse where within my workspace (i.e. /eclipse/worspace/C_tutorial) I have a seperate folder for each chapter (ch1, ch2, ch3..etc). Within each chapter I may have multiple projects. So far I've been unsuccessful doing this in Eclipse. I can create a workspace for each chapter directory, but I'd prefer not changing workspaces everytime I want to bring up a different chapter. I tried creating both a folder and source folder within eclipse but I can't create projects within the folder.
Any suggestions?
|
|
| Help with variables |
[29 Aug 2005|04:58pm] |
Ok, so this is my problem:
double dec1 = 5.76; string varDecName = "dec1";
Now, using varDecName, how can I access the 5.76 for use in calculations?
[EDIT:] I decided to go a simpler route and just used arrays. My final code is as follows:
#define COUNT 5
double decimal[COUNT];
double intAverage;
int integer[COUNT];
int iIndex, intSum;
cout << "Please enter " << COUNT << " positive decimal numbers." << endl;
for (i=0; i<COUNT; i)
{
cout << i << ": ";
cin >> decimal[i];
}
for (iIndex=0; iIndex<COUNT; iIndex)
{
integer[iIndex] = static_cast<int>(decimal[iIndex] +0.5);
}
|
|