Tuesday, July 14, 2009

C++ windows programming?

Hi this is in C++ using Borland....i have an error "Constant expression required" on this line : "TableType aTable[x];"...it seem that the number from "edit-%26gt;text" is not valid...Can somebody tell me why it wont take the value of "edit-%26gt;text"?





x=edit-%26gt;Text.ToIntDef(0);





TableType aTable[x];





aTable[x].tableNo= MyRest.findTable(edtNo-%26gt;Text.ToIntDef(0)...


aTable[x].computerType = (edtname-%26gt;Text.ToIntDef(0));


aTable[x].name = GuestName-%26gt;Text;


aTable[x].arrivalTime = Arrival-%26gt;Text;


aTable[x].departTime = Departure-%26gt;Text;

C++ windows programming?
the compiler needs to know the size of the aTable array so it can allocate the memory for it. If you give it fixed size it will work, something like:


TableType aTable[50];


Another option is to malloc().


Need urgent help with Borland!!?

I'v downloaded Borland for learning C. I'v got tests in 3 days. But i dont know hot to use it to write a program. Borland is on the C drive in a folder known as BCC65.. Pls help me!! I don know how to use it.. How do u write a program or execute it.. Pls help me.. I have my test coming up

Need urgent help with Borland!!?
go to the directory and type bcc.exe


How to install Borland Compiler?

I recently downloaded the 5.5 command line tool. I hav installed the .exe file.





But im unable to configure the compiler to run. I cant interpret the instructions in the readme file.





Pl help. i have completed step 1.





Installing and running the Command Line Tools


--------------------------------------...





1. Run freecommandlinetools.exe; choose the


drive and folder into which you want to


install the free C++Builder 5 command line


tool development system.





2. From the bin directory of your installation:


a. Add "c:\Borland\Bcc55"


to the existing path


b. Create a bcc32.cfg file which will set


the compiler options for the Include


and Lib paths (-I and -L switches to


compiler) by adding these lines:


-I"c:\Borland\Bcc55\include"


-L"c:\Borland\Bcc55\lib"


c. Create an ilink32.cfg file which will set


the linker option for the Lib path by


adding this line:


-L"c:\Borland\Bcc55\lib"

How to install Borland Compiler?
Ok, when step 1. completed it would have made a new folder. I will assume you did not change the name of this folder.





For step 2, part a.


If you are using Windows XP, go to 'Control Panel' (open it). Select 'System' (open it). Look for the 'Advanced' tab (select it). At the bottom is a button that says 'Environment Variables' (click on this). In the window that appears, you should see an entry for 'PATH'. Select this entry. Click on the 'Edit' button. Do not overwrite the text in here. What you want to do is to go to the end of the text in 'Variable value:'. Add this string without the quotes ";C:\Borland\BCC55\Bin" to the end of the PATH variable.


Note: There may be a 'Path' variable not a 'PATH', or even both 'Path' and 'PATH'. If you only have one, add it to the one. If you have two, add it to the one in the 'System variable' box/area.





If you are using windows 98, you can add to the path variable in the autoexec.bat file. This is usually located in the c: drive, and not in any folder You will need to right click (with your mouse) on the file and select 'edit' to be able to open it in a text editor. Add this string without the quotes ";C:\Borland\BCC55\Bin" to the end of the PATH variable. Ie, it usually says path=something;something\else;etc





For step 2, part b.


Create a new text file and rename it bcc32.cfg


To edit this file, right click (with your mouse) on the file (after selecting it). Then select 'edit'.


In this file you will need to add the lines mentioned.





For step 2 part c.


Create another text file and rename it 'ilink32.cfg'


Open it to edit as in the part b.


Add the lines mentioned.





Then, you will need to open a MS-DOS or Command Prompt box, if you use win98 or winXP, respectively. It is usually situated in Start -%26gt; All Programs -%26gt; Accessories





After opening the MS-DOS or Command Prompt, type in 'bcc32 -?" without the quotes into the command prompt. If all the above steps are successful, you will see a help message displayed.





Good luck.





[update] ps, you will need to add (create) those files in the 'C:\Borland\BCC55\Bin' folder / directory.
Reply:that happened to me. i just updated it
Reply:Try to check if your Command Compiler is in windows environment path


- Open Contol Panel - System


- On Advanced tab, click environment Variables


- In system variables, check if your c:\Borland\Bcc55 or c:\Borland\Bcc55\bin it's include in the path parameter, if not, edit and add the path.





Remember to check your command compiler wheter in c:\Borland\Bcc55 or c:\borland\Bcc55\Bin.





Hope this Help


What is the code to print the extended ascii character set in c++?

I'm using borland turbo c++ if that helps

What is the code to print the extended ascii character set in c++?
I'd say just use a loop from 0 to 255, and print the integer converted to a character, like this:





int i;


char character;


for (i=0; i %26lt; 255; i++)


{


character = i;


cout %26lt;%26lt; character %26lt;%26lt; endl;


}
Reply:well i dont really know, but i wud think u wudnt have to do anything, either that or make the chars unsigned

wedding reception flowers

Using communication ports on Windows XP with Borlad Builder C++... Please HELPPPP!!!!!?

I need to be able to control a device via the parallel and the serial port. The platform is Windows XP and the compiler I'm using is Borland Builder C++. How can I do this if importb and outportb are no longer supported? I know I have to use the CreateFile function. How does this work? Any help will be appreciated!!!

Using communication ports on Windows XP with Borlad Builder C++... Please HELPPPP!!!!!?
try searching for some code on http://www.codeproject.com I dont know borland c++, but I found some code for doing it in vc++.


I want to run an exe file from my c++ application that has to run simultaniously with the calling program,how.

i am using borland turbo c++ 5.01 version on windows xp , there r no arguments to be passed can anyone give me the command to do that.(let abc.exe be the file to be run give me the exact command).

I want to run an exe file from my c++ application that has to run simultaniously with the calling program,how.
execxxx,system and spawn are the choices
Reply:I'm not sure how to fork a process in Windows.





But the system() command should get you some of the way there.


Plz plz plz any one tell me the program to compare two strings in c++?

i want an program showing the comparison of c++


and one more thing i want to know how to inpute the graphics in Borland turbo c++ v4.5.





i am looking for a friend who could help me in my c++ problem.i wamt to chat with him .if any one want to help me then im me ar add me as friend my id is abhishek_vermaya@yahoo.co.in

Plz plz plz any one tell me the program to compare two strings in c++?
Strings can be compared by using library function strcmp, for this header file "string.h" must be included. Function receive two string argument and returns 0 when string1 is same as string2, returns +ve no when string1 is greater than string2 and returns -ve no when string1 is less than string2.





Syntex:- int strcmp(char*,char*)


e.g.


#include%26lt;iostream.h%26gt;


#include%26lt;string.h%26gt;


void main()


{


char *st1="Ajay Kumar", *st2="Amit Kumar";





cout%26lt;%26lt;strcmp(st1,st2);


}





function will display -3 because second string is greater (according to alphabet) i.e. j - m = -3
Reply:PLEASE REFER THE WEBSITE www.cplusplus.com .
Reply:use the function strcmp()
Reply:i dont know da seriously....how can i solve ur problem??im helpless
Reply:UltraCompare: http://www.ultraedit.com/index.php?name=...