|
||||||
| Managed C++ Visual Studio .NET managed C++ Topics |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
i am trying to write a program with two arrays...
my code:: Code:
// project5.cpp : main project file.
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
double hours __gc[] = new double __gc[10];
double charges __gc[] = new double __gc[10];
double total;
do
Console::WriteLine( L"Enter the number of hours parked:" );
hours[i] = Double::Parse( Console::ReadLine() );
if hours[i] > 24
Console::WriteLine( L"Maximum number of hours has been exceeded");
while hours[i] > 24
if hours[i] <= 2
charges[i] = 5
else
charges[i] = ((hours - 2) * .5) + 5;
if hours[i] > 10
charges[i] = 10;
Console::WriteLine( L"Car Number:\tHoursParked:\tAmount Charged:");
for (double i = 1, i <= 10, i++)
Console::WriteLine( L "{0}\t\t{1}\t\t{2}", i.ToString(), hours[i].ToString(), charges[i].ToString() );
for (int i = 0; i<charges-> Length; i++)
total += charges[i];
Console::WriteLine( L"Total Charges from Yesterday: {0}", total.ToString() );
return 0;
}
ERRORS: .\project5.cpp(9) : error C4980: '__gc' : use of this keyword requires /clrldSyntax command line option .\project5.cpp(9) : error C2440: 'initializing' : cannot convert from 'double *' to 'double []' There are no conversions to array types, although there are conversions to references or pointers to arrays .\project5.cpp(10) : error C2440: 'initializing' : cannot convert from 'double *' to 'double []' There are no conversions to array types, although there are conversions to references or pointers to arrays .\project5.cpp(15) : error C2061: syntax error : identifier 'hours' .\project5.cpp(16) : error C2061: syntax error : identifier 'hours' .\project5.cpp(18) : error C2061: syntax error : identifier 'hours' .\project5.cpp(25) : error C2061: syntax error : identifier 'hours' .\project5.cpp(30) : error C2143: syntax error : missing ',' before '<=' .\project5.cpp(30) : error C2086: 'double i' : redefinition .\project5.cpp(30) : see declaration of 'i' .\project5.cpp(33) : error C2227: left of '->Length' must point to class/struct/union/generic type type is 'double []' Edit/Delete Message Last edited by WingedPanther; 05-04-2008 at 07:08 PM. Reason: add code tags |
| Sponsored Links |
|
|
|
|||||
|
It looks like __gc is not defined in the current scope.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||
|
yaaa fur sure there is mistakes in the codes ...... it happend to me once but i fixed it by a programmer who is travelling all over the world finding helpless poeple who cannot solve errors like meee
..... thanx |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dynamic Arrays | Fedex | C and C++ | 3 | 12-02-2007 04:45 PM |
| Python arrays... | Sir_Rimo | Delphi/Python | 3 | 06-20-2007 08:54 AM |
| Arrays | clookid | PHP Tutorials | 1 | 01-11-2007 08:30 PM |
| Arrays | Sionofdarkness | C and C++ | 5 | 07-26-2006 05:35 PM |
| Arrays in NET 2.0 or CLI Managed C++ | Void | Managed C++ | 1 | 07-18-2006 07:57 PM |