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().
Tuesday, July 14, 2009
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
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
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
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++.
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.
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=...
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=...
I want to pause execution a of c++ program for 1 hour is there any direct function?what is my best option?
iam using borland turbo c++ on windows xp.
I want to pause execution a of c++ program for 1 hour is there any direct function?what is my best option?
this is the shortest simplest (least overhead) method I've seen for making a sleep function.
#include %26lt;time.h%26gt;
void sleep(unsigned int mseconds)
{
clock_t goal = mseconds + clock();
while (goal %26gt; clock());
}
Reply:Yeah, you can use sleep. If you are doing a console application, I see no other option. Otherwise, when you want to being processing you can keep track of time and spawn a thread. This thread simply compares the logged time with the current time, and executes a task after an hour has passed.
Reply:use timer
Reply:use
delay(seconds);
function
flowers gifts
I want to pause execution a of c++ program for 1 hour is there any direct function?what is my best option?
this is the shortest simplest (least overhead) method I've seen for making a sleep function.
#include %26lt;time.h%26gt;
void sleep(unsigned int mseconds)
{
clock_t goal = mseconds + clock();
while (goal %26gt; clock());
}
Reply:Yeah, you can use sleep. If you are doing a console application, I see no other option. Otherwise, when you want to being processing you can keep track of time and spawn a thread. This thread simply compares the logged time with the current time, and executes a task after an hour has passed.
Reply:use timer
Reply:use
delay(seconds);
function
flowers gifts
I am developing a code in c++ and in my code i need to run an application(an exe file) how can i do that.?
iam using borland turbo c++ 5.01 version and running on windows xp.
I am developing a code in c++ and in my code i need to run an application(an exe file) how can i do that.?
system(abc.exe);
runs the abc.exe from c++ code
spawn and execxxx may help too
Reply:In c/c++ there are set of functions like
%26lt;b%26gt;
exec
spawn
%26lt;/b%26gt;
and many of its derivatives which lets u run any .exe file from ur code.
They even provide more controlls like what the calling program will do till the called program runs.
U can even pass parameters to the called program.
Like u want to run note pad with argument "abc.txt" u need to call
%26lt;i%26gt;
spawnl(null,"notepad.exe","abc.txt");
%26lt;/i%26gt;
{
Obviously ur file abc.txt should be in the same directory or compleate path is required.
}
all these functions are defined in %26lt;b%26gt;process.h%26lt;/b%26gt;
I am developing a code in c++ and in my code i need to run an application(an exe file) how can i do that.?
system(abc.exe);
runs the abc.exe from c++ code
spawn and execxxx may help too
Reply:In c/c++ there are set of functions like
%26lt;b%26gt;
exec
spawn
%26lt;/b%26gt;
and many of its derivatives which lets u run any .exe file from ur code.
They even provide more controlls like what the calling program will do till the called program runs.
U can even pass parameters to the called program.
Like u want to run note pad with argument "abc.txt" u need to call
%26lt;i%26gt;
spawnl(null,"notepad.exe","abc.txt");
%26lt;/i%26gt;
{
Obviously ur file abc.txt should be in the same directory or compleate path is required.
}
all these functions are defined in %26lt;b%26gt;process.h%26lt;/b%26gt;
Creating a parabola in C++?
I'm using Borland turbo C++, first off.
I need to create an illusion of a parabola, using a "for" loop.
I already have set up a coordinate plane with tick marks, and the program asks the user for the A,B, and C values of the quadratic equation. I just need some help on creating the "parabola". Should I use line function and make it so every so many few pixels are marked and eventually create curves, or what?
D:
Any help would be appreciated :]
Creating a parabola in C++?
OK This was a fun thing to do and it is a little confusing until you understand where the screen coordinates actually are and what is needed to be done to flip and offset the values so that the drawn parabola appears correct.
I have 3 examples showing whats needed to be done to draw the parabola correctly, the comments hopefully explain my intentions.
I used putpixel() for the first 2 and the line() only on the last correct parabola as line() needs to remember the previously drawn points.
Good luck.
--------------------------------------...
#include %26lt;graphics.h%26gt;
#include %26lt;stdlib.h%26gt;
#include %26lt;stdio.h%26gt;
#include %26lt;conio.h%26gt;
int main()
{
// Set the graphics mode
int graphdriver = DETECT, graphmode;
initgraph(%26amp;graphdriver, %26amp;graphmode, "c:\\tc\\bgi");
double end_x = (double)getmaxx();
double end_y = (double)getmaxy();
double x = 0;
double y = 0;
int prev_x=0;
int prev_y=0;
// Draw the parabola
for (x=-1*(int)(end_x/2); x%26lt;(int)(end_x/2); x+=.1)
{
// substitute this equation with your entered values
y = .03*(x*x);
// .03 used to make the current parabola look nicer
/*
** 1) Drawn in BLUE - straight drawing of the parabola
** the coordinates of the screen have the (0,0) in the top right corner
** and (end_x, end_y) in the bottom left corner
** If you draw only using the values it appears upside down and to the left
*/
putpixel((int)x, (int)y, BLUE);
/*
** 2) Drawn in RED - drawing of the parabola and flipping it the right way
** using the end_(x,y) - (x,y) we draw the parabola the correct way
** It is still offset to the wrong side of the screen though
*/
putpixel((int)(end_x-x), (int)(end_y-y), RED);
/*
** 3) Drawn in WHITE - correct drawing of the parabola
** using 2) and then subtracting (end_(x,y)/2) we are able to
** place the parabola in the center of the screen ie that location
** is now the coordinates (0,0)
*/
//putpixel((int)(end_x-x) - (int)(end_x/2.0), (int)(end_y-y) - (int)(end_y/2.0), WHITE);
line((int)(end_x-x) - (int)(end_x/2.0), (int)(end_y-y) - (int)(end_y/2.0), prev_x, prev_y);
// when using line() we need to remember the prev x,y values
prev_x = (int)(end_x - x) - (int)(end_x/2.0);
prev_y = (int)(end_y - y) - (int)(end_y/2.0);
}
// Close the graphics mode.
getch();
closegraph();
return 0;
}
daylily
I need to create an illusion of a parabola, using a "for" loop.
I already have set up a coordinate plane with tick marks, and the program asks the user for the A,B, and C values of the quadratic equation. I just need some help on creating the "parabola". Should I use line function and make it so every so many few pixels are marked and eventually create curves, or what?
D:
Any help would be appreciated :]
Creating a parabola in C++?
OK This was a fun thing to do and it is a little confusing until you understand where the screen coordinates actually are and what is needed to be done to flip and offset the values so that the drawn parabola appears correct.
I have 3 examples showing whats needed to be done to draw the parabola correctly, the comments hopefully explain my intentions.
I used putpixel() for the first 2 and the line() only on the last correct parabola as line() needs to remember the previously drawn points.
Good luck.
--------------------------------------...
#include %26lt;graphics.h%26gt;
#include %26lt;stdlib.h%26gt;
#include %26lt;stdio.h%26gt;
#include %26lt;conio.h%26gt;
int main()
{
// Set the graphics mode
int graphdriver = DETECT, graphmode;
initgraph(%26amp;graphdriver, %26amp;graphmode, "c:\\tc\\bgi");
double end_x = (double)getmaxx();
double end_y = (double)getmaxy();
double x = 0;
double y = 0;
int prev_x=0;
int prev_y=0;
// Draw the parabola
for (x=-1*(int)(end_x/2); x%26lt;(int)(end_x/2); x+=.1)
{
// substitute this equation with your entered values
y = .03*(x*x);
// .03 used to make the current parabola look nicer
/*
** 1) Drawn in BLUE - straight drawing of the parabola
** the coordinates of the screen have the (0,0) in the top right corner
** and (end_x, end_y) in the bottom left corner
** If you draw only using the values it appears upside down and to the left
*/
putpixel((int)x, (int)y, BLUE);
/*
** 2) Drawn in RED - drawing of the parabola and flipping it the right way
** using the end_(x,y) - (x,y) we draw the parabola the correct way
** It is still offset to the wrong side of the screen though
*/
putpixel((int)(end_x-x), (int)(end_y-y), RED);
/*
** 3) Drawn in WHITE - correct drawing of the parabola
** using 2) and then subtracting (end_(x,y)/2) we are able to
** place the parabola in the center of the screen ie that location
** is now the coordinates (0,0)
*/
//putpixel((int)(end_x-x) - (int)(end_x/2.0), (int)(end_y-y) - (int)(end_y/2.0), WHITE);
line((int)(end_x-x) - (int)(end_x/2.0), (int)(end_y-y) - (int)(end_y/2.0), prev_x, prev_y);
// when using line() we need to remember the prev x,y values
prev_x = (int)(end_x - x) - (int)(end_x/2.0);
prev_y = (int)(end_y - y) - (int)(end_y/2.0);
}
// Close the graphics mode.
getch();
closegraph();
return 0;
}
daylily
C++ Do-While Loop Question...?
Hello. :]
I'm using Borland Turbo C++, and making a program in which the user may enter an integer. Then, they are asked for another, and then shown the product of the two entered. They may continue entering integers, and the product will be modified after they enter another integer. The flag is 0, and th e program will terminate when the user enters it.
My only question is that during my do-while loop, what should I use as a variable, as far as what the user enters, so that when I do product=variable*variable, I get the answer, and not just product=num*num , whereas it'll just multiply the entered value by itself?
Thanks!
C++ Do-While Loop Question...?
Try this out in your code..
int product = 1;//starts at 1 so you can mutiply
int entered = 0;
int loops = 0;
do
{
cout%26lt;%26lt;"Enter an integer, 0 to stop"%26lt;%26lt;endl;
cin%26gt;%26gt;entered;
if(entered !=0)
product = product * entered;
loops++;
}while(entered != 0);
if(loops == 1)
product = 0;
cout%26lt;%26lt;"Product is "%26lt;%26lt;product%26lt;%26lt;endl;
Reply:If understand correctly you are asking user to enter the number and multily all the numbers until he enters a zero.
In do while loop put this code
product=product * num
Reply:well, after the initial product, your equation will actually change to product = previous product * integer. am i correct? so you could have two different variables like:
//input two integers at first, then put new integer into variable 2
product = variable1*variable2
variable1 = product
loop
i hope this helps, my c++ is a little rusty. good luck!
I'm using Borland Turbo C++, and making a program in which the user may enter an integer. Then, they are asked for another, and then shown the product of the two entered. They may continue entering integers, and the product will be modified after they enter another integer. The flag is 0, and th e program will terminate when the user enters it.
My only question is that during my do-while loop, what should I use as a variable, as far as what the user enters, so that when I do product=variable*variable, I get the answer, and not just product=num*num , whereas it'll just multiply the entered value by itself?
Thanks!
C++ Do-While Loop Question...?
Try this out in your code..
int product = 1;//starts at 1 so you can mutiply
int entered = 0;
int loops = 0;
do
{
cout%26lt;%26lt;"Enter an integer, 0 to stop"%26lt;%26lt;endl;
cin%26gt;%26gt;entered;
if(entered !=0)
product = product * entered;
loops++;
}while(entered != 0);
if(loops == 1)
product = 0;
cout%26lt;%26lt;"Product is "%26lt;%26lt;product%26lt;%26lt;endl;
Reply:If understand correctly you are asking user to enter the number and multily all the numbers until he enters a zero.
In do while loop put this code
product=product * num
Reply:well, after the initial product, your equation will actually change to product = previous product * integer. am i correct? so you could have two different variables like:
//input two integers at first, then put new integer into variable 2
product = variable1*variable2
variable1 = product
loop
i hope this helps, my c++ is a little rusty. good luck!
How2 run turbo c in winxp?
i am learing c from a book.i loaded the program borland turbo c but it aint compiling any programe i write..y is it so???????????
How2 run turbo c in winxp?
copy the turbo c in any directory.go in start --%26gt; run--%26gt;command--%26gt; cd\ ---%26gt;drive in which u copy the main files---%26gt;cd file-name of turbo c--%26gt;turboc3 or tc (what ever Ur exe files name---%26gt;;
e.g i m saving the file in d: and file name is turboc3.
on dos command window
cd\
cd turboc3
tc
after opening c++ screen go in directories check the path if path is write then compile ur prog it will so the result.
plz select best answer if this will work
Reply:I'm not sure. I remember I tried using turbo c once, and I seem to remember that it would only run from the root directory for some reason.
Might I suggest that you try Pelles C?
http://www.smorgasbordet.com/pellesc/
It's newer and much friendlier than turbo c, which is something of a fossil these days.
And Pelles C is also free!
Reply:Look for gcc (GNU C Compiler) - it's free and very good. I use it for Windows and Linux alike.
Rawlyn.
How2 run turbo c in winxp?
copy the turbo c in any directory.go in start --%26gt; run--%26gt;command--%26gt; cd\ ---%26gt;drive in which u copy the main files---%26gt;cd file-name of turbo c--%26gt;turboc3 or tc (what ever Ur exe files name---%26gt;;
e.g i m saving the file in d: and file name is turboc3.
on dos command window
cd\
cd turboc3
tc
after opening c++ screen go in directories check the path if path is write then compile ur prog it will so the result.
plz select best answer if this will work
Reply:I'm not sure. I remember I tried using turbo c once, and I seem to remember that it would only run from the root directory for some reason.
Might I suggest that you try Pelles C?
http://www.smorgasbordet.com/pellesc/
It's newer and much friendlier than turbo c, which is something of a fossil these days.
And Pelles C is also free!
Reply:Look for gcc (GNU C Compiler) - it's free and very good. I use it for Windows and Linux alike.
Rawlyn.
C++ Error?
"Possibly incorrect assignment in function Addition()"
I could post my code, but I rather just know what causes that error?
I can search for the error myself, if it means a specific thing is wrong, but I'm just wondering.
And, I'm using Borland Turbo C++, so you know.
C++ Error?
In the code from an earlier question you have this :
if(D=!C)
which sets D to the logical not of C, then the statement is true if D != 0. D and C are integers. I'm sure this isn't what you intended, and the statement should be this:
if (D != C)
Reply:Is this a run-time or compile error? Sounds like a compile error and the compiler is detecting a type mismatch or a potential bounds error. (e.g. you are assinging a float to an int, or a long to and int)
Reply:sorry i don't know.but i will ask my sis.
Reply:This is usually caused by making this simple mistake.
if (avalue=1)
// instead of
if (avalue==1)
In the first case you assign 1 to avalue and the statement is always true! DOH!
In the second case you test for avalue being equal to 1.
Look closely at your comparisons!
I could post my code, but I rather just know what causes that error?
I can search for the error myself, if it means a specific thing is wrong, but I'm just wondering.
And, I'm using Borland Turbo C++, so you know.
C++ Error?
In the code from an earlier question you have this :
if(D=!C)
which sets D to the logical not of C, then the statement is true if D != 0. D and C are integers. I'm sure this isn't what you intended, and the statement should be this:
if (D != C)
Reply:Is this a run-time or compile error? Sounds like a compile error and the compiler is detecting a type mismatch or a potential bounds error. (e.g. you are assinging a float to an int, or a long to and int)
Reply:sorry i don't know.but i will ask my sis.
Reply:This is usually caused by making this simple mistake.
if (avalue=1)
// instead of
if (avalue==1)
In the first case you assign 1 to avalue and the statement is always true! DOH!
In the second case you test for avalue being equal to 1.
Look closely at your comparisons!
Drawing A Line --- C++?
I need to draw a basic line in C++, and if anyone could help, it'd be great.
If someone taught me how to create one line with tick marks, that'd be better, but I'd be happy with just being told how to draw one line. [Take in mind, that I don't want to prompt the user to draw a line, I just want to "print out" one to the screen.]
Thanks for any help with this :]
And by the way, I'm using Borland Turbo C++.
Drawing A Line --- C++?
hello,
it has been a long time since I used Borland so please bear with me.
Drawing a line on the screen may not prove to be very difficult. First all you have to do is to check for "graphics.h" if you have one.
If you have none, then I guess you have no choice but to use printf() function.
However If you do have, please check out the link that I am sending you. It is not a line (actually a circle) but has great explanation on how to do it :)
Take care and hope I have helped you.
PS : if i remember correctly, graphics.h also has a line() function with the following syntax :
line(xstart, ystart, xend, yend);
I am not so sure but you can try reading/scanning graphics.h for the command. Cheers =)
Reply:C++ has no native drawing abilities. If you are working in a console then the only way to simulate drawing is to use a output of "---------------" characters, otherwise you will have to move onto Windows programming to do any type of graphics work.
Reply:As farp says,, you can't drow a line in C++ environment, except if you wrote a code like this I think it will be possible :
[ cout %26lt;%26lt; "___________" %26lt;%26lt; end1 ]
or like this code
[ cout %26lt;%26lt; "---------------------" %26lt;%26lt; end1 ]
Good Luck :)
flamingo plant
If someone taught me how to create one line with tick marks, that'd be better, but I'd be happy with just being told how to draw one line. [Take in mind, that I don't want to prompt the user to draw a line, I just want to "print out" one to the screen.]
Thanks for any help with this :]
And by the way, I'm using Borland Turbo C++.
Drawing A Line --- C++?
hello,
it has been a long time since I used Borland so please bear with me.
Drawing a line on the screen may not prove to be very difficult. First all you have to do is to check for "graphics.h" if you have one.
If you have none, then I guess you have no choice but to use printf() function.
However If you do have, please check out the link that I am sending you. It is not a line (actually a circle) but has great explanation on how to do it :)
Take care and hope I have helped you.
PS : if i remember correctly, graphics.h also has a line() function with the following syntax :
line(xstart, ystart, xend, yend);
I am not so sure but you can try reading/scanning graphics.h for the command. Cheers =)
Reply:C++ has no native drawing abilities. If you are working in a console then the only way to simulate drawing is to use a output of "---------------" characters, otherwise you will have to move onto Windows programming to do any type of graphics work.
Reply:As farp says,, you can't drow a line in C++ environment, except if you wrote a code like this I think it will be possible :
[ cout %26lt;%26lt; "___________" %26lt;%26lt; end1 ]
or like this code
[ cout %26lt;%26lt; "---------------------" %26lt;%26lt; end1 ]
Good Luck :)
flamingo plant
Parabola in C++?
Hi, I'm a 15 year old student, and I'm using Borland Turbo C++.
I have gotten one reply previously on this question, but I cannot exactly understand how to create a parabola based only on user entered values of the A, B, and C values.
Any help would immensly help.
Thank you~
Parabola in C++?
um, i guess it depends what interface are you using for your output.
if you use the command prompt, i would measure how many characters you can put in from the x and y axis that would fit the screen. then divide the x axis by 2, (if you want your parabola to be center at 0,0 and is a x^2 type. second you would make a for loop from -10 to 10. and type two marks that are X amt of distance between each other and symmetric to the x axis, and increasing to the X^2
I have gotten one reply previously on this question, but I cannot exactly understand how to create a parabola based only on user entered values of the A, B, and C values.
Any help would immensly help.
Thank you~
Parabola in C++?
um, i guess it depends what interface are you using for your output.
if you use the command prompt, i would measure how many characters you can put in from the x and y axis that would fit the screen. then divide the x axis by 2, (if you want your parabola to be center at 0,0 and is a x^2 type. second you would make a for loop from -10 to 10. and type two marks that are X amt of distance between each other and symmetric to the x axis, and increasing to the X^2
Help with c++?
I've no experience in programming, It just happen happen that we had a computer class and we are using C++. by the way I'm using the borland turbo c++ v1.01
This program below is a sample program I found in the Internet. When I enter this program it says "unable to open include file STDIO.H". Is there something wrong with this program? Help me please
#include %26lt;stdio.h%26gt;
main () {
int i,n,sum;
scanf("%d",%26amp;n);
sum=0;
i=1;
while (i%26lt;=n) {
sum = sum + i;
i++;
}
printf("%d",sum);
}
Help with c++?
Looks like C code instead of C++, judging by the way the main function is declared without a return type. Not sure if it has anything to do with stdio.h though. Most c++ compilers come with it.
The C++ version would probably look like:
#include %26lt;iostream%26gt;
int main()
{
int n, sum=0;
std::cin %26gt;%26gt; n;
for(int i = 1; i%26lt;=n; i++)
{
sum+=i;
}
std::cout %26lt;%26lt; sum;
return 0;
}
Reply:Looks like c code. Try Dev-C++. The compiler that your computer is using probably doesn't recognize studio.h. I suggest dev-c++, the compiler is a lot better.
You can download it from the internet for free.
cheers!!!
Reply:Your compiler has not been installed correctly or you have changed where the compiler looks for its #include files.
Try reinstalling Turbo C++, that will fix where it searches for files #included.
Dazza
This program below is a sample program I found in the Internet. When I enter this program it says "unable to open include file STDIO.H". Is there something wrong with this program? Help me please
#include %26lt;stdio.h%26gt;
main () {
int i,n,sum;
scanf("%d",%26amp;n);
sum=0;
i=1;
while (i%26lt;=n) {
sum = sum + i;
i++;
}
printf("%d",sum);
}
Help with c++?
Looks like C code instead of C++, judging by the way the main function is declared without a return type. Not sure if it has anything to do with stdio.h though. Most c++ compilers come with it.
The C++ version would probably look like:
#include %26lt;iostream%26gt;
int main()
{
int n, sum=0;
std::cin %26gt;%26gt; n;
for(int i = 1; i%26lt;=n; i++)
{
sum+=i;
}
std::cout %26lt;%26lt; sum;
return 0;
}
Reply:Looks like c code. Try Dev-C++. The compiler that your computer is using probably doesn't recognize studio.h. I suggest dev-c++, the compiler is a lot better.
You can download it from the internet for free.
cheers!!!
Reply:Your compiler has not been installed correctly or you have changed where the compiler looks for its #include files.
Try reinstalling Turbo C++, that will fix where it searches for files #included.
Dazza
Subroutines, C++?
Subroutines, C++?
Hello.
I'm using Borland Turbo C++, first off.
I'm using subroutines, and for the first choice, which takes you to the first subroutine, it'll go through and everything, and then it will return to the "menu screen" asking the user for a choice.
1 for Addition, 2 for Subtraction, 3 for Multiplication, 4 for Division, and 5 for Quit.
1 works perfect, and returns to the menu.
2-4 work fine, but at the end, it doesn't return to the menu.
5 works fine, and ends the program like it should.
Is there a reason that 2-4 do this? Are they supposed to automatically return to the "menu" at the end, or is there a way to make it return to the said menu?
Thanks =]
And, as asked, I'll post my code.
However, I'm just going to host the CPP file on mediafire, as it'll be hard to post on here, on the extra details part.
=]
http://www.mediafire.com/?ccrp4mh3rgd
Subroutines, C++?
Before I give you a proper answer, I should mention that you're using both deprecated and non-standard libraries in this program which, unless your teacher said you could, will not give you a good grade.
The answer is quite simple... for whatever reason, before you do your looping test, you force all values of "choice" that are greater than 1 to be equal to 5. Think about this... you tell all values of choice greater than 1 to be 5 and then immediately you say "if choice equals 5, exit the loop". I didn't immediately notice any syntax errors that the person above me noticed, however, I did not compile the program. My first guess however is that he tried to compile it, didn't have conio.h, saw the errors and assumed you have syntax problems.
Charles, this is now the second time in two days that I've had to correct you. This guy is clearly doing this for a class, so why would you suggest changing the syntax when you don't even know what was taught in the class to this point? I mean, honestly... switch statements? Is that the only thing you can find worth changing in his syntax?
Reply:There're a lot of errors check your code
semicolons and the brackets check them
Reply:You might try the switch/case to do this, but don't change the value of choice - code looks nicer this way.
Also, you should get rid of clrscr(). It's platform specific, and doesnt work for most people. Including conio - Just get rid of conio... (Hope your class doesn't require clearing the screen, if so - ask them why? You'll never use that in a future job, the old pkzip never cleared the screen. )
main(void)
{
int choice;
do{
//clrscr();
cout%26lt;%26lt;"1. Addition\n";
cout%26lt;%26lt;"2. Subtraction\n";
cout%26lt;%26lt;"3. Multiplication\n";
cout%26lt;%26lt;"4. Division\n";
cout%26lt;%26lt;"5. Quit\n";
cout%26lt;%26lt;"Choice: ";
cin%26gt;%26gt;choice;
switch (choice) {
case 1 : Addition(); break;
case 2 : Subtraction(); break;
case 3 : Multiplication(); break;
case 4 : Division(); break;
case 5 : break; //do nothing
default: cout %26lt;%26lt; "Invalid Choice\n"; break;
}
}while (choice !=5);
}
Hello.
I'm using Borland Turbo C++, first off.
I'm using subroutines, and for the first choice, which takes you to the first subroutine, it'll go through and everything, and then it will return to the "menu screen" asking the user for a choice.
1 for Addition, 2 for Subtraction, 3 for Multiplication, 4 for Division, and 5 for Quit.
1 works perfect, and returns to the menu.
2-4 work fine, but at the end, it doesn't return to the menu.
5 works fine, and ends the program like it should.
Is there a reason that 2-4 do this? Are they supposed to automatically return to the "menu" at the end, or is there a way to make it return to the said menu?
Thanks =]
And, as asked, I'll post my code.
However, I'm just going to host the CPP file on mediafire, as it'll be hard to post on here, on the extra details part.
=]
http://www.mediafire.com/?ccrp4mh3rgd
Subroutines, C++?
Before I give you a proper answer, I should mention that you're using both deprecated and non-standard libraries in this program which, unless your teacher said you could, will not give you a good grade.
The answer is quite simple... for whatever reason, before you do your looping test, you force all values of "choice" that are greater than 1 to be equal to 5. Think about this... you tell all values of choice greater than 1 to be 5 and then immediately you say "if choice equals 5, exit the loop". I didn't immediately notice any syntax errors that the person above me noticed, however, I did not compile the program. My first guess however is that he tried to compile it, didn't have conio.h, saw the errors and assumed you have syntax problems.
Charles, this is now the second time in two days that I've had to correct you. This guy is clearly doing this for a class, so why would you suggest changing the syntax when you don't even know what was taught in the class to this point? I mean, honestly... switch statements? Is that the only thing you can find worth changing in his syntax?
Reply:There're a lot of errors check your code
semicolons and the brackets check them
Reply:You might try the switch/case to do this, but don't change the value of choice - code looks nicer this way.
Also, you should get rid of clrscr(). It's platform specific, and doesnt work for most people. Including conio - Just get rid of conio... (Hope your class doesn't require clearing the screen, if so - ask them why? You'll never use that in a future job, the old pkzip never cleared the screen. )
main(void)
{
int choice;
do{
//clrscr();
cout%26lt;%26lt;"1. Addition\n";
cout%26lt;%26lt;"2. Subtraction\n";
cout%26lt;%26lt;"3. Multiplication\n";
cout%26lt;%26lt;"4. Division\n";
cout%26lt;%26lt;"5. Quit\n";
cout%26lt;%26lt;"Choice: ";
cin%26gt;%26gt;choice;
switch (choice) {
case 1 : Addition(); break;
case 2 : Subtraction(); break;
case 3 : Multiplication(); break;
case 4 : Division(); break;
case 5 : break; //do nothing
default: cout %26lt;%26lt; "Invalid Choice\n"; break;
}
}while (choice !=5);
}
Can i write c programs in windows xp? i have no problems using c on win98 & earlier.?
i use turbo c or borland / turbo c++ compiler. there is no problem with 98 %26amp; earlier. is there any solution?
Can i write c programs in windows xp? i have no problems using c on win98 %26amp; earlier.?
Go to borland website and post a question regarding this problem. But most probably you need to update your libraries files the .h extension. most likely it is the IDE(intergrated development environment) that contain the compiler that did not work try buying a new one or using an open source IDE like http://www.bloodshed.net/ If you want make a donation. :)
Reply:I've tried the compiler from blodshed.net and it works great with XP.
Reply:Borland TC++ works under XP as well as under 9x.
Reply:I really don't understand what your question is!
Reply:To program in a Windows C++ environment these days, you have to use Visual C++ or the .NET C# program. I'm sure there are other alternatives, but most people stick with the Microsoft products.
Reply:Ahhh Yes/ No maybe
ELL if I No
umbrella plant
Can i write c programs in windows xp? i have no problems using c on win98 %26amp; earlier.?
Go to borland website and post a question regarding this problem. But most probably you need to update your libraries files the .h extension. most likely it is the IDE(intergrated development environment) that contain the compiler that did not work try buying a new one or using an open source IDE like http://www.bloodshed.net/ If you want make a donation. :)
Reply:I've tried the compiler from blodshed.net and it works great with XP.
Reply:Borland TC++ works under XP as well as under 9x.
Reply:I really don't understand what your question is!
Reply:To program in a Windows C++ environment these days, you have to use Visual C++ or the .NET C# program. I'm sure there are other alternatives, but most people stick with the Microsoft products.
Reply:Ahhh Yes/ No maybe
ELL if I No
umbrella plant
C++ Program Help?
I'm using Borland Turbo C++.
Okay, here's my code:
http://www.mediafire.com/?0hnrz1nxm31
Apparently, I have to use long ints or something
to limit my numbers for my fraction subroutine, as far as multiplication and division.
I need to figure out how to limit it.
It seems okay with easy,
but when it gets to medium and hard,
it shows my numerator as - [number here]
.
For medium I can go from 1-99.
For hard 99-999.
And for decimals, I have to
make the numbers larger for medium and hard.
Any help correcting my code would be greatly appreciated.
Thanks~
And, if you completely correct my code and host it.
or tell me exactly where to put whatever snippets.
I'd greatly appreciate it.
This is due in two days, and I have no clue
what to do past this %26gt;_%26lt;
Thanks.
C++ Program Help?
If you're using cout, you should be using endl instead of embedding \n in your strings.
You only need one temporary variable to swap two numbers. With A and B, do C = A, A = B, B = C.
I don't know if Turbo C++ uses 16 or 32 bit ints. If they're 16-bit, then you could possibly overflow because you have ANum=(A*B1)*(A1*B) where A %26lt;= 26, B %26lt;= 50, A1 %26lt;= 25, B1 %26lt;= 50. Using the maximum values gets you (26*50)*(25*50) = 1,625,000 which is way more than the signed 16-bit limit of 32767. Use "long" instead of "int" and keep trying.
A good code pasting site is http://pastebin.com/
Reply:Wow!!! The reason why ur r confused is the fact that ur using too many functions.
For eg
Have three functions namely:
void lvl1(char op) // op can take '+', '-', '*' or '/'
{
.............// Randomize
.............// whatevr loop
.............switch (op)
.............{
........................case '+' : ans = a + b; // Whatevr variables used
.........................................
........................// Similarly for others
.............}
............. // Get Answer and check using simple if
}
Similarly for other levels
void lvl2(char);
void lvl3(char);
and u cud also use only 3 random generating subroutines for l1, l2 %26amp; l3
After this try analyzing the problem, the solution comes to you automatically......
Okay, here's my code:
http://www.mediafire.com/?0hnrz1nxm31
Apparently, I have to use long ints or something
to limit my numbers for my fraction subroutine, as far as multiplication and division.
I need to figure out how to limit it.
It seems okay with easy,
but when it gets to medium and hard,
it shows my numerator as - [number here]
.
For medium I can go from 1-99.
For hard 99-999.
And for decimals, I have to
make the numbers larger for medium and hard.
Any help correcting my code would be greatly appreciated.
Thanks~
And, if you completely correct my code and host it.
or tell me exactly where to put whatever snippets.
I'd greatly appreciate it.
This is due in two days, and I have no clue
what to do past this %26gt;_%26lt;
Thanks.
C++ Program Help?
If you're using cout, you should be using endl instead of embedding \n in your strings.
You only need one temporary variable to swap two numbers. With A and B, do C = A, A = B, B = C.
I don't know if Turbo C++ uses 16 or 32 bit ints. If they're 16-bit, then you could possibly overflow because you have ANum=(A*B1)*(A1*B) where A %26lt;= 26, B %26lt;= 50, A1 %26lt;= 25, B1 %26lt;= 50. Using the maximum values gets you (26*50)*(25*50) = 1,625,000 which is way more than the signed 16-bit limit of 32767. Use "long" instead of "int" and keep trying.
A good code pasting site is http://pastebin.com/
Reply:Wow!!! The reason why ur r confused is the fact that ur using too many functions.
For eg
Have three functions namely:
void lvl1(char op) // op can take '+', '-', '*' or '/'
{
.............// Randomize
.............// whatevr loop
.............switch (op)
.............{
........................case '+' : ans = a + b; // Whatevr variables used
.........................................
........................// Similarly for others
.............}
............. // Get Answer and check using simple if
}
Similarly for other levels
void lvl2(char);
void lvl3(char);
and u cud also use only 3 random generating subroutines for l1, l2 %26amp; l3
After this try analyzing the problem, the solution comes to you automatically......
C++ help???
i have a project created in visual c++ containing multiple cpp files header files etc.
i have never use visual c++ and only use borland turbo c++ is there any idea how to compile these files.
C++ help???
if you use
#include "C:\filelocation"
if you want to see them in the list on the left, it's something like project%26gt;add to project%26gt;file or project %26gt; add file to project, BUT you still have to use #include statements.
i have never use visual c++ and only use borland turbo c++ is there any idea how to compile these files.
C++ help???
if you use
#include "C:\filelocation"
if you want to see them in the list on the left, it's something like project%26gt;add to project%26gt;file or project %26gt; add file to project, BUT you still have to use #include statements.
Help in C++?
I'm very new to C++. Can anyone tell me why this function doesn't work?
bool UnlockDrive(char PW[70])
{
if (PW!="") {
char ExecString[350];
ExecString = "";
char sys1[90];
sys1 = "start \"mount.exe /v locked.dsk /l z /h n /c n /p \"";
char sys2[90];
sys2 = "\" /m rm /q\"";
strcat(ExecString, sys1);
strcat(ExecString, PW);
strcat(ExecString, sys2);
system(ExecString);
}
return true;
}
I'm using Borland Turbo C++ version 10.0. I get the following error when I try to build the application:
Lvalue required
It is referring to the lines:
ExecString = "";
sys1 = "start \"mount.exe /v locked.dsk /l z /h n /c n /p \"";
sys2 = "\" /m rm /q\"";
Any help would be greatly appreciated!
Help in C++?
ExecString, sys1 and sys2 have their size declared, I think you need to set them to a string literal containing the same number of characters. What you can do is this instead:
char *ExecString = NULL, *sys1 = NULL, *sys2 = NULL;
sys1 = "start \"mount.exe /v locked.dsk /l z /h n /c n /p \"";
sys2 = "\" /m rm /q\"";
strcat(ExecString, sys1);
strcat(ExecString, PW);
strcat(ExecString, sys2);
system(ExecString);
Reply:Since u r using C++ use standard library's string class std::string instead of char *:
using namespace std;
std::string execstring;
execstring = "" ....
system(execstring.c_str()); Report It
Reply:The problem is ExecString="". This is in conflict with the definition just one line above.
There are many ways to fix this.
(1) If you change that line to strcpy( ExecString, "" ) you should be fine.
(2) Or you could eliminate that line change the strcat(ExecString, sys1); to strcpy(ExecString, sys1);
Good luck!
bool UnlockDrive(char PW[70])
{
if (PW!="") {
char ExecString[350];
ExecString = "";
char sys1[90];
sys1 = "start \"mount.exe /v locked.dsk /l z /h n /c n /p \"";
char sys2[90];
sys2 = "\" /m rm /q\"";
strcat(ExecString, sys1);
strcat(ExecString, PW);
strcat(ExecString, sys2);
system(ExecString);
}
return true;
}
I'm using Borland Turbo C++ version 10.0. I get the following error when I try to build the application:
Lvalue required
It is referring to the lines:
ExecString = "";
sys1 = "start \"mount.exe /v locked.dsk /l z /h n /c n /p \"";
sys2 = "\" /m rm /q\"";
Any help would be greatly appreciated!
Help in C++?
ExecString, sys1 and sys2 have their size declared, I think you need to set them to a string literal containing the same number of characters. What you can do is this instead:
char *ExecString = NULL, *sys1 = NULL, *sys2 = NULL;
sys1 = "start \"mount.exe /v locked.dsk /l z /h n /c n /p \"";
sys2 = "\" /m rm /q\"";
strcat(ExecString, sys1);
strcat(ExecString, PW);
strcat(ExecString, sys2);
system(ExecString);
Reply:Since u r using C++ use standard library's string class std::string instead of char *:
using namespace std;
std::string execstring;
execstring = "" ....
system(execstring.c_str()); Report It
Reply:The problem is ExecString="". This is in conflict with the definition just one line above.
There are many ways to fix this.
(1) If you change that line to strcpy( ExecString, "" ) you should be fine.
(2) Or you could eliminate that line change the strcat(ExecString, sys1); to strcpy(ExecString, sys1);
Good luck!
What is the code in c++ if i want to type r and it will run or type esc it will escape. Im using Borland 3.0?
Im using stdio.h conio.h etc but im not using iostream. we have a project called the game of life! we have the formulas loops and etc. but we dont how to do the "press esc to exit press r to run press space to create cells and blah blah"
What is the code in c++ if i want to type r and it will run or type esc it will escape. Im using Borland 3.0?
Use the ISO std function getch() to get the next input character and return its value. Pressing the space bar will cause getch() to return 0x20 (32 decimal.) The escape key: 0x1b (27 decimal.) Lower-case r: 0x72 (114 decimal.)
Reply:This may be pseudocode... but hey, it's been a while for me :-P
something like:
if (Asc(getChar()) == "r") {
//code
}
or maybe a "keyDown" callback function or something
Reply:If you do a getchar() from standard input and compare the result with 'r' and ' ', won't that work? I don't know what you'll get for the escape key though. Will it be the ASCII code for ESC '\033' I think but i can't remember.
The only thing is that input from a keyboard is typically line oriented, i.e. you have to hit the enter key before your input is given to the program. There are system specific ways of changing this behaviour so that your program gets each character as it's typed. You need to consult your system documentation for this.
deliver flowers
What is the code in c++ if i want to type r and it will run or type esc it will escape. Im using Borland 3.0?
Use the ISO std function getch() to get the next input character and return its value. Pressing the space bar will cause getch() to return 0x20 (32 decimal.) The escape key: 0x1b (27 decimal.) Lower-case r: 0x72 (114 decimal.)
Reply:This may be pseudocode... but hey, it's been a while for me :-P
something like:
if (Asc(getChar()) == "r") {
//code
}
or maybe a "keyDown" callback function or something
Reply:If you do a getchar() from standard input and compare the result with 'r' and ' ', won't that work? I don't know what you'll get for the escape key though. Will it be the ASCII code for ESC '\033' I think but i can't remember.
The only thing is that input from a keyboard is typically line oriented, i.e. you have to hit the enter key before your input is given to the program. There are system specific ways of changing this behaviour so that your program gets each character as it's typed. You need to consult your system documentation for this.
deliver flowers
Where can I get a program that allows me to write c++?
I would like Borland c++ version. I think it has to do with Turbo, maybe? I'm looking for the program that allows you to write the souce code and then you press execute and it will compile it and run it. I don't know what to call this type of program though.
Where can I get a program that allows me to write c++?
IDE %26amp; Compiler. Here ya go:
http://www.thefreecountry.com/compilers/...
EDIT: Integrated Development Environment - where you type the program in - typically w/quick compile, link, %26amp; run. (And in some cases form building resources.)
Depending on what you're looking to do (either console [DOS/Unix-Linux Command Line] or Forms) you could just stick with the MS C++ 2008 Freebie compiler from that list.
Borland is still viable if it's on your mind to use it, especially the DOS [turbo] version. (I think there's a free version on that list as well.)
Reply:damn girl. u are so fine, y r u messin with all this geeky *** computer **** anyway. u need to hit up my email so we can do somethin a lil more interesting.
-HOLLA
Reply:A compiler is what you're looking for.
Here is a link to download the borland freeware version: http://www.sofotex.com/Borland-C++-Compi... If you own a mac it there will already be a C++ compiler that comes with your machine.
Reply:Its called an IDE
Turbo c++
http://dn.codegear.com/article/21751
Dev C++
http://sourceforge.net/project/downloadi...
EDIT:
An IDE (Integrated Development Environment) is compiler, text editor and everything all in one.
Reply:Well it's called a compiler. Look for Borland Turbo c++ (like you said up there). I'm sure you could whack that in Google and at least get a trial version.
Reply:You definatly need an IDE.
Doing all that, compile, link takes too much time, so why not do it all in on time?
Use Dev-C++, it's good;
http://www.bloodshed.net/devcpp.html
Reply:http://www.microsoft.com/express/downloa...
Microsoft visual studioes C++ Express Edition is the free version, there is also a professional development version which does cost money, but if you are just learning I would recomend sticking to the free Express version.
Where can I get a program that allows me to write c++?
IDE %26amp; Compiler. Here ya go:
http://www.thefreecountry.com/compilers/...
EDIT: Integrated Development Environment - where you type the program in - typically w/quick compile, link, %26amp; run. (And in some cases form building resources.)
Depending on what you're looking to do (either console [DOS/Unix-Linux Command Line] or Forms) you could just stick with the MS C++ 2008 Freebie compiler from that list.
Borland is still viable if it's on your mind to use it, especially the DOS [turbo] version. (I think there's a free version on that list as well.)
Reply:damn girl. u are so fine, y r u messin with all this geeky *** computer **** anyway. u need to hit up my email so we can do somethin a lil more interesting.
-HOLLA
Reply:A compiler is what you're looking for.
Here is a link to download the borland freeware version: http://www.sofotex.com/Borland-C++-Compi... If you own a mac it there will already be a C++ compiler that comes with your machine.
Reply:Its called an IDE
Turbo c++
http://dn.codegear.com/article/21751
Dev C++
http://sourceforge.net/project/downloadi...
EDIT:
An IDE (Integrated Development Environment) is compiler, text editor and everything all in one.
Reply:Well it's called a compiler. Look for Borland Turbo c++ (like you said up there). I'm sure you could whack that in Google and at least get a trial version.
Reply:You definatly need an IDE.
Doing all that, compile, link takes too much time, so why not do it all in on time?
Use Dev-C++, it's good;
http://www.bloodshed.net/devcpp.html
Reply:http://www.microsoft.com/express/downloa...
Microsoft visual studioes C++ Express Edition is the free version, there is also a professional development version which does cost money, but if you are just learning I would recomend sticking to the free Express version.
Why does a compiler come out of program of c++ on its own without compiling and terminating the whole program?
i am using borland c++
Why does a compiler come out of program of c++ on its own without compiling and terminating the whole program?
There were probably errors detected in your code.
Why does a compiler come out of program of c++ on its own without compiling and terminating the whole program?
There were probably errors detected in your code.
How I can find work in home for C++ programming?
I am an experienced programmer in Borland C++ 5.02. I want to fint the ways I can do some projects in home.
How I can find work in home for C++ programming?
Here are some sites. Good luck on rates -- they tend to be "offshore-ish".
Elance: http://www.elance.com
Guru: http://www.guru.com
GetAFreelancer: http://www.getafreelancer.com
RentACoder.com: http://www.rentacoder.com
Scriptlance: http://www.scriptlance.com
GetACoder.com: http://www.getacoder.com
How I can find work in home for C++ programming?
Here are some sites. Good luck on rates -- they tend to be "offshore-ish".
Elance: http://www.elance.com
Guru: http://www.guru.com
GetAFreelancer: http://www.getafreelancer.com
RentACoder.com: http://www.rentacoder.com
Scriptlance: http://www.scriptlance.com
GetACoder.com: http://www.getacoder.com
I would like to print colored chars on screen using Visual C++ IDE. What's the function to use? I know about..
I know about the cprintf(), textcolor() functions in Borland C. But I want such type of funcitons in VIsual C Not in C++. Please let me know!
I would like to print colored chars on screen using Visual C++ IDE. What's the function to use? I know about..
This Link will surely help you
http://msdn.microsoft.com/msdnmag/issues...
Reply:there is a function in conio.h
called textcolor
u can use it as
textcolor(RED+BLINK);
cprintf("hello");
BLINK will make the text to blink
floral bouquets
I would like to print colored chars on screen using Visual C++ IDE. What's the function to use? I know about..
This Link will surely help you
http://msdn.microsoft.com/msdnmag/issues...
Reply:there is a function in conio.h
called textcolor
u can use it as
textcolor(RED+BLINK);
cprintf("hello");
BLINK will make the text to blink
floral bouquets
I am using the DEV-C++ software, still when I compile and then try to run the code it won't launch. What is th
I have used till now a compiler the Borland C++ that was created in 1990 (yes that old). Give me an example of a working code. Maybe I have written mine wrong.
my code9 keep in mind that this code is used by me to test this compiler):
#include%26lt;iostream.h%26gt;
void main()
{double a,b,S;
cout%26lt;%26lt;"Input the lenght of the rectangle"%26lt;%26lt;endl;
cin%26lt;%26lt;a;
cout%26lt;%26lt;"Input the width of the rectangle"%26lt;%26lt;endl;
cin%26lt;%26lt;b;
S=a*b;
cout%26lt;%26lt;"The area of the rectangle is..."%26lt;%26lt;endl;
cout%26lt;%26lt;" "%26lt;%26lt;endl;
cout%26lt;%26lt;S;
}
I am using the DEV-C++ software, still when I compile and then try to run the code it won't launch. What is th
// #include%26lt;iostream.h%26gt;
// This is wrong, you should use the alias these days
#include %26lt;iostream%26gt;
// You need to add this too (or prefix the functions below with
// std::, so cin becomes std::cin etc).
using namespace std;
// This is a useful website:
// http://www.cppreference.com
// main must have correct signature
//void main()
int main(int argc, char **argv)
{double a,b,S;
cout%26lt;%26lt;"Input the lenght of the rectangle"%26lt;%26lt;endl;
//cin%26lt;%26lt;a;
// this way round
cin %26gt;%26gt; a;
cout%26lt;%26lt;"Input the width of the rectangle"%26lt;%26lt;endl;
//cin%26lt;%26lt;b;
cin %26gt;%26gt; b;
S=a*b;
cout%26lt;%26lt;"The area of the rectangle is..."%26lt;%26lt;endl;
cout%26lt;%26lt;" "%26lt;%26lt;endl;
//cout%26lt;%26lt;S;
// need CRLF.
cout %26lt;%26lt; S %26lt;%26lt; endl;
// return success
return 0;
}
Reply:I dont know if this is a type mistake but cin should be like this
cin %26gt;%26gt; variable_name
After compile, make sure you get 0 errors and an executable file is created then run the exe file
my code9 keep in mind that this code is used by me to test this compiler):
#include%26lt;iostream.h%26gt;
void main()
{double a,b,S;
cout%26lt;%26lt;"Input the lenght of the rectangle"%26lt;%26lt;endl;
cin%26lt;%26lt;a;
cout%26lt;%26lt;"Input the width of the rectangle"%26lt;%26lt;endl;
cin%26lt;%26lt;b;
S=a*b;
cout%26lt;%26lt;"The area of the rectangle is..."%26lt;%26lt;endl;
cout%26lt;%26lt;" "%26lt;%26lt;endl;
cout%26lt;%26lt;S;
}
I am using the DEV-C++ software, still when I compile and then try to run the code it won't launch. What is th
// #include%26lt;iostream.h%26gt;
// This is wrong, you should use the alias these days
#include %26lt;iostream%26gt;
// You need to add this too (or prefix the functions below with
// std::, so cin becomes std::cin etc).
using namespace std;
// This is a useful website:
// http://www.cppreference.com
// main must have correct signature
//void main()
int main(int argc, char **argv)
{double a,b,S;
cout%26lt;%26lt;"Input the lenght of the rectangle"%26lt;%26lt;endl;
//cin%26lt;%26lt;a;
// this way round
cin %26gt;%26gt; a;
cout%26lt;%26lt;"Input the width of the rectangle"%26lt;%26lt;endl;
//cin%26lt;%26lt;b;
cin %26gt;%26gt; b;
S=a*b;
cout%26lt;%26lt;"The area of the rectangle is..."%26lt;%26lt;endl;
cout%26lt;%26lt;" "%26lt;%26lt;endl;
//cout%26lt;%26lt;S;
// need CRLF.
cout %26lt;%26lt; S %26lt;%26lt; endl;
// return success
return 0;
}
Reply:I dont know if this is a type mistake but cin should be like this
cin %26gt;%26gt; variable_name
After compile, make sure you get 0 errors and an executable file is created then run the exe file
Where can I find software for C++ programming ?
Borland c programmes?
Where can I find software for C++ programming ?
You can go to www.download.com. There many free software. Type your search in search box and select free.
Reply:Use limewire
Reply:Hi Madhuvan, i have the software for C++ programming.
If you need it, just drop me a mail, i'll forward that software to you..
My email id is chetan_9118@yahoo.com
Reply:On the internet. Try searching a search engine.
Reply:for anything and everything .. go to download.com
Reply:Goto Google.com and in the search engine type
C++ Software Download
and select particular site and start downloading it.
or you can contact me at
milind04mca08@gmail.com
www.download.com
www.codeguru.com
Reply:Goto Google.com and in the search engine type
C++ Software Download
and select particular site and start downloading it.
or you can contact me at
eralmas7@yahoo.com
Reply:You can try gcc.gnu.org or cygwin(google for the word cygwin, first hit should take you to the site). With cygwin installed you get a host of development tools to work with.
Where can I find software for C++ programming ?
You can go to www.download.com. There many free software. Type your search in search box and select free.
Reply:Use limewire
Reply:Hi Madhuvan, i have the software for C++ programming.
If you need it, just drop me a mail, i'll forward that software to you..
My email id is chetan_9118@yahoo.com
Reply:On the internet. Try searching a search engine.
Reply:for anything and everything .. go to download.com
Reply:Goto Google.com and in the search engine type
C++ Software Download
and select particular site and start downloading it.
or you can contact me at
milind04mca08@gmail.com
www.download.com
www.codeguru.com
Reply:Goto Google.com and in the search engine type
C++ Software Download
and select particular site and start downloading it.
or you can contact me at
eralmas7@yahoo.com
Reply:You can try gcc.gnu.org or cygwin(google for the word cygwin, first hit should take you to the site). With cygwin installed you get a host of development tools to work with.
Can anyone write a code snippet in C for adjoint of a matrix?
I use borland C. I am technically sound but have been C only since a month now. I will able to understand higher levels.
Can anyone write a code snippet in C for adjoint of a matrix?
Well, here's some working java code, which you should be able to translate into C ...
Can anyone write a code snippet in C for adjoint of a matrix?
Well, here's some working java code, which you should be able to translate into C ...
Making a game in C++?
I'm making a math game in Borland C++ v4.52.
The game is basically having multiple mathematical problems slowly go down the screen and the user can then enter the answer to a question. While the user is entering the question, all questions are still moving down the screen.
I don't know how to make it so that the user can simultaneously answer the question and have the mathematical questions move down the screen.
If anyone has a website or some code they can offer me, that'd be great.
Thanks in advance.
Making a game in C++?
Use conio.h with kbhit(), then, when kbhit() is true, read from the input using getch[e]() (using cin or scanf creates a General Protection Error).
dried flowers
The game is basically having multiple mathematical problems slowly go down the screen and the user can then enter the answer to a question. While the user is entering the question, all questions are still moving down the screen.
I don't know how to make it so that the user can simultaneously answer the question and have the mathematical questions move down the screen.
If anyone has a website or some code they can offer me, that'd be great.
Thanks in advance.
Making a game in C++?
Use conio.h with kbhit(), then, when kbhit() is true, read from the input using getch[e]() (using cin or scanf creates a General Protection Error).
dried flowers
Inportb and outportb in C++?
what version of borland C++ support the
inportb and outportb functions.
how do i use this function in VC++???
tnx
Inportb and outportb in C++?
Well I'm not sure that one version will support and others won't. I think it has to do more with including the dos.h header file. Not entirely sure on that though.
I just got it to work in Dev-C++ which is a great free IDE http://www.bloodshed.net/devcpp.html its fast and you dont need all the included crap that comes with VC++. But if you want to use VC++ try this code . .
#include %26lt;dos.h%26gt;
int main(void)
{
int outportb (unsigned int port, int value);
unsigned int outport (unsigned int port, unsigned int value);
int outp (unsigned int port, int value);
unsigned int outportw (unsigned int port, unsigned int value);
outportb(0x9D4,0xc9);
}
inportb and outportb functions.
how do i use this function in VC++???
tnx
Inportb and outportb in C++?
Well I'm not sure that one version will support and others won't. I think it has to do more with including the dos.h header file. Not entirely sure on that though.
I just got it to work in Dev-C++ which is a great free IDE http://www.bloodshed.net/devcpp.html its fast and you dont need all the included crap that comes with VC++. But if you want to use VC++ try this code . .
#include %26lt;dos.h%26gt;
int main(void)
{
int outportb (unsigned int port, int value);
unsigned int outport (unsigned int port, unsigned int value);
int outp (unsigned int port, int value);
unsigned int outportw (unsigned int port, unsigned int value);
outportb(0x9D4,0xc9);
}
I want to write an application in C++, i need your help?
1- how many versions of C++ are available? (i'm not talking about Visaul or microsoft products)
2- from where can i download it?
3- if there is many kinds (like borland C++) which one is better and what is the difference?
thanks alot!!!!!!!!!!!!!!!!!!!!!!!!
I want to write an application in C++, i need your help?
http://en.wikipedia.org/wiki/C++
http://bdn.borland.com/article/0,1410,21...
Reply:informative! thanks! Report It
2- from where can i download it?
3- if there is many kinds (like borland C++) which one is better and what is the difference?
thanks alot!!!!!!!!!!!!!!!!!!!!!!!!
I want to write an application in C++, i need your help?
http://en.wikipedia.org/wiki/C++
http://bdn.borland.com/article/0,1410,21...
Reply:informative! thanks! Report It
What is "using namespace std;" in C++??
what does it do? Is this code a recent addition? I had started C++ 2 years ago and then switched to java .Back then nobody tought me to use it("using namespace std;") ever not even once.Was my teacher dumb??
and the compiler i use says"Namespace name expected " every time i include this peice of code in the program.The compiler i use is Borland C++ version 5.03 .Is it a source of the problem??help me out guys.
What is "using namespace std;" in C++??
Without getting too complicated -- basically they have created a way in C++ to differentiate between different areas of "namespace" in such a way that you could potentially have multiple objects or typedefs, etc of the same name that don't overlap. The "std" namespace is where most things in the C++ header files (iostream for example) live.
For example I could create a class and call it "string", even though a class called "string" already exists, if I put it in a different namespace.
I would guess that you are using something like a cout, cin, endl, string, or other predefined type/object. "cout" for example is actually called "std::cout", but by putting "using namespace std;" you are able to leave off the "std::" part.
Reply:"namespace" is the essential part of C++. To understand what any namespace means (as e.g. namespace std), just read any C++ book.
Reply:some classes etc. are declared in _namespaces_, std - is one of that nmespaces. To access that class you need resolve the namespace.
Taht could be performed with: using namespace xxxx; (as an option)
For instance:
#include %26lt;vector%26gt;
#include %26lt;map%26gt;
using namespace std;
....
vector%26lt;int%26gt; v;
map%26lt;int,int%26gt; m;
********************** or *****************
#include %26lt;vector%26gt;
#include %26lt;map%26gt;
....
std::vector%26lt;int%26gt; v;
std::map%26lt;int,int%26gt; m;
--------------------------------------...
good luck
Reply:You might like to read this for a decent introduction to namespaces:
http://www.glenmccl.com/ns_comp.htm
I would recommend switching back to C++ and leaving Java well alone - better to learn to use a tool than a toy.
Rawlyn.
and the compiler i use says"Namespace name expected " every time i include this peice of code in the program.The compiler i use is Borland C++ version 5.03 .Is it a source of the problem??help me out guys.
What is "using namespace std;" in C++??
Without getting too complicated -- basically they have created a way in C++ to differentiate between different areas of "namespace" in such a way that you could potentially have multiple objects or typedefs, etc of the same name that don't overlap. The "std" namespace is where most things in the C++ header files (iostream for example) live.
For example I could create a class and call it "string", even though a class called "string" already exists, if I put it in a different namespace.
I would guess that you are using something like a cout, cin, endl, string, or other predefined type/object. "cout" for example is actually called "std::cout", but by putting "using namespace std;" you are able to leave off the "std::" part.
Reply:"namespace" is the essential part of C++. To understand what any namespace means (as e.g. namespace std), just read any C++ book.
Reply:some classes etc. are declared in _namespaces_, std - is one of that nmespaces. To access that class you need resolve the namespace.
Taht could be performed with: using namespace xxxx; (as an option)
For instance:
#include %26lt;vector%26gt;
#include %26lt;map%26gt;
using namespace std;
....
vector%26lt;int%26gt; v;
map%26lt;int,int%26gt; m;
********************** or *****************
#include %26lt;vector%26gt;
#include %26lt;map%26gt;
....
std::vector%26lt;int%26gt; v;
std::map%26lt;int,int%26gt; m;
--------------------------------------...
good luck
Reply:You might like to read this for a decent introduction to namespaces:
http://www.glenmccl.com/ns_comp.htm
I would recommend switching back to C++ and leaving Java well alone - better to learn to use a tool than a toy.
Rawlyn.
How can I compile a .dll using microsoft visual c++ 6?
I need to compile a Dinamyc Library that was originaly developed under Borland C, but now we need to migrate to Visual C++, and I would like to use the same code I used before. How can I compile a .dll using visual C++?
How can I compile a .dll using microsoft visual c++ 6?
Well u need to know how to make the dll workspace to work in it right ?
in your vc++ open new project and choose dynamic link library .. then import all you cpp and headers files into this new project .
finally just remove the default cpp file created with the new project that u don't need it anymore , and save yourworkspace and you can start compilation now .
Reply:Does it need to be recompiled? One of the strengths of DLLs is their reusability - you can write a DLL in C then import it into pretty much any language and use it quite happily, and this normally doesn't mean recompiling.
gift baskets
How can I compile a .dll using microsoft visual c++ 6?
Well u need to know how to make the dll workspace to work in it right ?
in your vc++ open new project and choose dynamic link library .. then import all you cpp and headers files into this new project .
finally just remove the default cpp file created with the new project that u don't need it anymore , and save yourworkspace and you can start compilation now .
Reply:Does it need to be recompiled? One of the strengths of DLLs is their reusability - you can write a DLL in C then import it into pretty much any language and use it quite happily, and this normally doesn't mean recompiling.
gift baskets
How to use c++ 3.0 compiler in vista?
I just installed vista in my pc. But i can't use my old borland c++ compoler 3.0. The error says the dos-based programs are not allowe to work full-screen.
And in small window the graphics program are not compiled.
Any suggestions?
How to use c++ 3.0 compiler in vista?
http://www.bestvistadownloads.com/downlo...
And in small window the graphics program are not compiled.
Any suggestions?
How to use c++ 3.0 compiler in vista?
http://www.bestvistadownloads.com/downlo...
Complex program in c++...how do i solve it?
i want to program the following in borland c++..how do i get this in the output screen:
*
**
***
****
*****
%26amp; also the following:
*
**
***
****
*****
help me i have got test next week?
Complex program in c++...how do i solve it?
lol
just make a loop thats ends after 1 turn, and add the following:
printf("*");
printf("**");
printf("***");
printf("****");
printf("*****");
send me a message if you fail to do so
Reply:I'm not sure of what notions you have to apply to this, but I will suppose that you will have learned how to a) print to standard output, and b) use loops.* I'm also going to suppose that the format of the output is written from left to right, top to bottom, in the terminal/prompt.
You will have noticed one of a number of things from looking at the output : the number of asterisks ('*') on a given line is greater than the number of asterisks on the previous line. Basically, the number of asterisks on a given line increases as the depth of the line increases.
The first thing is to print the asterisks. We cannot print them directly, given that the number of asterisks varies per given line. However, we know that the number of asterisks is equivalent to the depth of a line (!!!!). In pseudo-code :
for i = 1 to depth do
print('*')
end_for
Great ! We now have the asterisks figured out. Now that we've focused on a line, let's focus on the whole of the triangle. Again : the number of asterisks in a line is proportional to the depth of that line. This means that the depth will increase as we add more lines. An increase in lines, and increase in asterisks...yet another loop :
/* to print depth lines */
for i = 1 to depth do
for j = 1 to i do
print('*')
end_for
print('\n') /* let's not forget to go to the next line */
end_for
In C++ that would give something like this :
--------------------------------------...
#include %26lt;iostream.h%26gt;
using namespace std;
void print_triangle(int depth)
{
int i;
int j;
for (i = 1; i %26lt;= depth; i++)
{
for (j = 1; j %26lt;= i; j++)
cout %26lt;%26lt; '*';
cout %26lt;%26lt; endl;
}
}
int main(void)
{
print_triangle(7); /* play with this value */
return 0;
}
--------------------------------------...
Check the includes, but this should work fine. I hope this helped.
Good luck on you exam.
____
* If you haven't used loops, then simply sequentially printing the lines.
Reply:Sorry, but if you consider that complex, then you don't deserve to pass the test. No matter the level of the course you're following. You should be able to do this after exactly one lesson in C++ programming.
*
**
***
****
*****
%26amp; also the following:
*
**
***
****
*****
help me i have got test next week?
Complex program in c++...how do i solve it?
lol
just make a loop thats ends after 1 turn, and add the following:
printf("*");
printf("**");
printf("***");
printf("****");
printf("*****");
send me a message if you fail to do so
Reply:I'm not sure of what notions you have to apply to this, but I will suppose that you will have learned how to a) print to standard output, and b) use loops.* I'm also going to suppose that the format of the output is written from left to right, top to bottom, in the terminal/prompt.
You will have noticed one of a number of things from looking at the output : the number of asterisks ('*') on a given line is greater than the number of asterisks on the previous line. Basically, the number of asterisks on a given line increases as the depth of the line increases.
The first thing is to print the asterisks. We cannot print them directly, given that the number of asterisks varies per given line. However, we know that the number of asterisks is equivalent to the depth of a line (!!!!). In pseudo-code :
for i = 1 to depth do
print('*')
end_for
Great ! We now have the asterisks figured out. Now that we've focused on a line, let's focus on the whole of the triangle. Again : the number of asterisks in a line is proportional to the depth of that line. This means that the depth will increase as we add more lines. An increase in lines, and increase in asterisks...yet another loop :
/* to print depth lines */
for i = 1 to depth do
for j = 1 to i do
print('*')
end_for
print('\n') /* let's not forget to go to the next line */
end_for
In C++ that would give something like this :
--------------------------------------...
#include %26lt;iostream.h%26gt;
using namespace std;
void print_triangle(int depth)
{
int i;
int j;
for (i = 1; i %26lt;= depth; i++)
{
for (j = 1; j %26lt;= i; j++)
cout %26lt;%26lt; '*';
cout %26lt;%26lt; endl;
}
}
int main(void)
{
print_triangle(7); /* play with this value */
return 0;
}
--------------------------------------...
Check the includes, but this should work fine. I hope this helped.
Good luck on you exam.
____
* If you haven't used loops, then simply sequentially printing the lines.
Reply:Sorry, but if you consider that complex, then you don't deserve to pass the test. No matter the level of the course you're following. You should be able to do this after exactly one lesson in C++ programming.
How to use the software CD that came with the C++ book by COHOON & DAVIDSON?
Here with the CD given that.
For use with the following compilers:
1)Borland C++ 5.02.
2)Microsoft Visual C++ 6.0.
3)Inprise C++ Builder 5.
And i have the compiler Microsoft Visual C++6.0,
so how to use the Ez windows API given with the
software CD by COHOON %26amp; DAVIDSON.
Please give the answer.
Early reply will be highly appreciated.
Thanking you.
Regards.
Satish kumar.
How to use the software CD that came with the C++ book by COHOON %26amp; DAVIDSON?
try blood shed dev c++ compiler i tried visual c++, borland, and many more i like blood shed dev c++ best and it has lots of templates that come bundled in with it, you can update the compilers library's with a breeze. try it out.
For use with the following compilers:
1)Borland C++ 5.02.
2)Microsoft Visual C++ 6.0.
3)Inprise C++ Builder 5.
And i have the compiler Microsoft Visual C++6.0,
so how to use the Ez windows API given with the
software CD by COHOON %26amp; DAVIDSON.
Please give the answer.
Early reply will be highly appreciated.
Thanking you.
Regards.
Satish kumar.
How to use the software CD that came with the C++ book by COHOON %26amp; DAVIDSON?
try blood shed dev c++ compiler i tried visual c++, borland, and many more i like blood shed dev c++ best and it has lots of templates that come bundled in with it, you can update the compilers library's with a breeze. try it out.
Can u tell me how to create a file in visual c++?
i am an engineering student
i am being taugth c language in borland c.
i want to do the programs in visual c++
i am new to visual c++
so please help me who to create a program in visual c++
or tell me the best website i can learn...........
Can u tell me how to create a file in visual c++?
Go to Microsoft and download Visual C++ Express.
http://msdn.microsoft.com/vstudio/expres...
plenty of tutorials out there on the web.
wedding
i am being taugth c language in borland c.
i want to do the programs in visual c++
i am new to visual c++
so please help me who to create a program in visual c++
or tell me the best website i can learn...........
Can u tell me how to create a file in visual c++?
Go to Microsoft and download Visual C++ Express.
http://msdn.microsoft.com/vstudio/expres...
plenty of tutorials out there on the web.
wedding
From where can i download C++ for free?
it may be turbo c++ or borland C++ latest version
From where can i download C++ for free?
go to www.freedwonload.com you will like it
Reply:http://www.download.com/
Reply:Go to http://dn.codegear.com/article/21751
Reply:search on
www.oldapps.com
best for old applications
Reply:Go to phazeddl.com and search c++
From where can i download C++ for free?
go to www.freedwonload.com you will like it
Reply:http://www.download.com/
Reply:Go to http://dn.codegear.com/article/21751
Reply:search on
www.oldapps.com
best for old applications
Reply:Go to phazeddl.com and search c++
Can you tell me a good IDE for programming in the C language?
I need to program in the C language, NOT C++. It's for something like putting code in some chips... something for putting C code in some hardware, this is why I need it.
Now I'm at the beginning, so don't know much... the programmer I talked to, said they need a program... and first I need to write some code in C...
What IDE to use, since the last one I used was Borland C 3.1...? I want to use one for Windows.
Also, tell me where to download it from?
Can you tell me a good IDE for programming in the C language?
The only one I've used is the Pelles C IDE; it's free to download and decent to work with; probably some of the paid ones offer more support, but this will get it done...
Reply:Microsoft makes the Visual Studio 2005 Express version available as a free download.
Now I'm at the beginning, so don't know much... the programmer I talked to, said they need a program... and first I need to write some code in C...
What IDE to use, since the last one I used was Borland C 3.1...? I want to use one for Windows.
Also, tell me where to download it from?
Can you tell me a good IDE for programming in the C language?
The only one I've used is the Pelles C IDE; it's free to download and decent to work with; probably some of the paid ones offer more support, but this will get it done...
Reply:Microsoft makes the Visual Studio 2005 Express version available as a free download.
In this c++ destructors are not getting initialized!!!!(destructors for obj2 and obj1 ar'nt invoked?
/*The life cycle of an object*/
#include%26lt;iostream%26gt;
#include%26lt;conio%26gt;
class Test
{
public:
Test()
{
cout%26lt;%26lt;"Constructor invoked"%26lt;%26lt;endl;
}
~Test()
{
cout%26lt;%26lt;"Destructor invoked"%26lt;%26lt;endl;
}
};
Test obj1;
int main()
{
cout%26lt;%26lt;"main() begins"%26lt;%26lt;endl;
Test obj2;
{
cout%26lt;%26lt;"Inner block begins"%26lt;%26lt;endl;
Test obj3;
cout%26lt;%26lt;"Inner block ends"%26lt;%26lt;endl;
}
cout%26lt;%26lt;"main() ends"%26lt;%26lt;endl;
getch();
return 0;
}
the output i get is
Constructor invoked
main() begins
Constructor invoked
Inner block begins
Constructor invoked
Inner block ends
Destructor invoked
main() ends
it should have been
Constructor invoked
main() begins
Constructor invoked
Inner block begins
Constructor invoked
Inner block ends
Destructor invoked
main() ends
Destructor invoked
Destructor invoked
plz help(destructor should automatically be initialized isn't it?)
i am using borland c++ builder 5.2 is it a factor??
In this c++ destructors are not getting initialized!!!!(destructors for obj2 and obj1 ar'nt invoked?
The following answer is absolutly correct ....
Constructor invoked
main() begins
Constructor invoked
Inner block begins
Constructor invoked
Inner block ends
Destructor invoked
main() ends
________________
|Destructor invoked |
|Destructor invoked |
|________________|
But u can't see the last 2 statements (showed in block)....here what actully happened is ...
The destructore for obj2 will be called after the "MAIN() FUNCTION" is terminated" (i.e. after the closing braces).
B'coz, obj2 is declaired in main() function, so its life is in the main() function's scope.
The destructor for obj1 will be called just b4 the "PROGARMM" is terminated (i.e. bust b4 the programm is removed from the memory).
B'coz, obj1 is a globle object of TEST class and its life is thruout the programm.
I dont know about the Borland Compiler, but in Turbo compiler you can se the output screen again after termination of the program using "ALT + F5" and doing this will show the real output...
u can contact me if u still have doubts... send me message.
Reply:I have altered some of your code so it will compile AND run. Forgive me as I have cut parts out regardless, I found you had multple problems with the code, such as how you were actually giving the function protyptes in the class actual code (only pass them parameters if needed, you do all the code you want the function to do in the defintion. A class can ONLY have one deconstrutor. Also if you are compling this in one file...as your code showed...then why did you not use namespace std? That was probably half of your errors right there you would have had to use std::cout %26lt;%26lt; "stuff on screen";
Good luck.
#include%26lt;iostream%26gt;
using namespace std;
//Define Class
class Test
{
public:
//Function Prototype
void TestFunction();
//Destructor
~Test();
};
int main()
{
//Declare object/variable
Test obj1;
cout%26lt;%26lt;"main() begins"%26lt;%26lt;endl;
//Function call
obj1.TestFunction();
cout%26lt;%26lt;"main() ends"%26lt;%26lt;endl;
system("pause");
return 0;
}
//Function Definitions
void Test::TestFunction()
{
cout%26lt;%26lt;"Inner block begins"%26lt;%26lt;endl;
}
Test::~Test()
{
}
Reply:Yeah, the last poster is right. I added this line at the top:
using namespace std;
and made other minor changes to get it going on unix.
I get the output you expected:
Constructor invoked
main() begins
Constructor invoked
Inner block begins
Constructor invoked
Inner block ends
Destructor invoked
main() ends
Destructor invoked
Destructor invoked
So, you might have an issue with text output. That doesn't explain why you get some lines printed out and not others, though. So, yeah, you might also have a flaky compiler, since the code works as expected with g++.
#include%26lt;iostream%26gt;
#include%26lt;conio%26gt;
class Test
{
public:
Test()
{
cout%26lt;%26lt;"Constructor invoked"%26lt;%26lt;endl;
}
~Test()
{
cout%26lt;%26lt;"Destructor invoked"%26lt;%26lt;endl;
}
};
Test obj1;
int main()
{
cout%26lt;%26lt;"main() begins"%26lt;%26lt;endl;
Test obj2;
{
cout%26lt;%26lt;"Inner block begins"%26lt;%26lt;endl;
Test obj3;
cout%26lt;%26lt;"Inner block ends"%26lt;%26lt;endl;
}
cout%26lt;%26lt;"main() ends"%26lt;%26lt;endl;
getch();
return 0;
}
the output i get is
Constructor invoked
main() begins
Constructor invoked
Inner block begins
Constructor invoked
Inner block ends
Destructor invoked
main() ends
it should have been
Constructor invoked
main() begins
Constructor invoked
Inner block begins
Constructor invoked
Inner block ends
Destructor invoked
main() ends
Destructor invoked
Destructor invoked
plz help(destructor should automatically be initialized isn't it?)
i am using borland c++ builder 5.2 is it a factor??
In this c++ destructors are not getting initialized!!!!(destructors for obj2 and obj1 ar'nt invoked?
The following answer is absolutly correct ....
Constructor invoked
main() begins
Constructor invoked
Inner block begins
Constructor invoked
Inner block ends
Destructor invoked
main() ends
________________
|Destructor invoked |
|Destructor invoked |
|________________|
But u can't see the last 2 statements (showed in block)....here what actully happened is ...
The destructore for obj2 will be called after the "MAIN() FUNCTION" is terminated" (i.e. after the closing braces).
B'coz, obj2 is declaired in main() function, so its life is in the main() function's scope.
The destructor for obj1 will be called just b4 the "PROGARMM" is terminated (i.e. bust b4 the programm is removed from the memory).
B'coz, obj1 is a globle object of TEST class and its life is thruout the programm.
I dont know about the Borland Compiler, but in Turbo compiler you can se the output screen again after termination of the program using "ALT + F5" and doing this will show the real output...
u can contact me if u still have doubts... send me message.
Reply:I have altered some of your code so it will compile AND run. Forgive me as I have cut parts out regardless, I found you had multple problems with the code, such as how you were actually giving the function protyptes in the class actual code (only pass them parameters if needed, you do all the code you want the function to do in the defintion. A class can ONLY have one deconstrutor. Also if you are compling this in one file...as your code showed...then why did you not use namespace std? That was probably half of your errors right there you would have had to use std::cout %26lt;%26lt; "stuff on screen";
Good luck.
#include%26lt;iostream%26gt;
using namespace std;
//Define Class
class Test
{
public:
//Function Prototype
void TestFunction();
//Destructor
~Test();
};
int main()
{
//Declare object/variable
Test obj1;
cout%26lt;%26lt;"main() begins"%26lt;%26lt;endl;
//Function call
obj1.TestFunction();
cout%26lt;%26lt;"main() ends"%26lt;%26lt;endl;
system("pause");
return 0;
}
//Function Definitions
void Test::TestFunction()
{
cout%26lt;%26lt;"Inner block begins"%26lt;%26lt;endl;
}
Test::~Test()
{
}
Reply:Yeah, the last poster is right. I added this line at the top:
using namespace std;
and made other minor changes to get it going on unix.
I get the output you expected:
Constructor invoked
main() begins
Constructor invoked
Inner block begins
Constructor invoked
Inner block ends
Destructor invoked
main() ends
Destructor invoked
Destructor invoked
So, you might have an issue with text output. That doesn't explain why you get some lines printed out and not others, though. So, yeah, you might also have a flaky compiler, since the code works as expected with g++.
HI c++ compiler help?
Where could i get a borland c++ 3.0 compiler for free dos version
HI c++ compiler help?
http://www.ecuadors.net/compilers.htm
g/l
Reply:First, you need to contact the lifeforms of the Vega star system. Request the proper file bytes from them. After a short period of time (a little over 50 years), you will receive the bytes of all necessary files from them in binary. Make sure to account for atmospheric interference if you're using a common radio frequency. Once you have the data, open your hex editor (you do have one, right?) and input the bytes one at a time. When you're finished, you should be able to use the compiler. You might need to do a few manual registry updates. Oh, and I think Vega is pretty trustworthy, but it couldn't hurt to run a virus scan on the file once you're finished downloading it. Vega might be planning something.
Reply:Well try searchin in www.soft32.com , or try to search in google
flowers on line
HI c++ compiler help?
http://www.ecuadors.net/compilers.htm
g/l
Reply:First, you need to contact the lifeforms of the Vega star system. Request the proper file bytes from them. After a short period of time (a little over 50 years), you will receive the bytes of all necessary files from them in binary. Make sure to account for atmospheric interference if you're using a common radio frequency. Once you have the data, open your hex editor (you do have one, right?) and input the bytes one at a time. When you're finished, you should be able to use the compiler. You might need to do a few manual registry updates. Oh, and I think Vega is pretty trustworthy, but it couldn't hurt to run a virus scan on the file once you're finished downloading it. Vega might be planning something.
Reply:Well try searchin in www.soft32.com , or try to search in google
flowers on line
From Where I Can Download "ANSI-C++ & C++ 4.0" ?
Also Tell Me What Is The Difference B/W "Turbo C++ %26amp; Borland C++" ?
From Where I Can Download "ANSI-C++ %26amp; C++ 4.0" ?
You do not download ANSI-C++, you download, or buy an ANSI-C++ compiler or Intergrate Development Environment (IDE).
You have to create a text file that contains the source of the c++ program you wish to make, an very simple one below:
include %26lt;iostream%26gt; // For writing to the screen / console
using std::cout; // To get the output stream
main()
{
cout %26lt;%26lt; "Hello Danishahmed25pk";
}
Thats the end of the program, save it in a text file with the extension .cpp
You will then need to compile it using the compiler or IDE you have.
Borland offers a free compiler [1] details at [2]. There is also a purchasable compiler on the page at [1].
From Borland about Turbo C++
"Turbo C++ version 1 was our first compiler that supported the C++ language. The C++ compiler conformed to AT%26amp;T's 2.0 specification for the C++ language."[3]
It appears the Turbo Debugger is still used on the free Borland C++.
Reply:Turbo C++ is the old Borland C++ compiler!
From Where I Can Download "ANSI-C++ %26amp; C++ 4.0" ?
You do not download ANSI-C++, you download, or buy an ANSI-C++ compiler or Intergrate Development Environment (IDE).
You have to create a text file that contains the source of the c++ program you wish to make, an very simple one below:
include %26lt;iostream%26gt; // For writing to the screen / console
using std::cout; // To get the output stream
main()
{
cout %26lt;%26lt; "Hello Danishahmed25pk";
}
Thats the end of the program, save it in a text file with the extension .cpp
You will then need to compile it using the compiler or IDE you have.
Borland offers a free compiler [1] details at [2]. There is also a purchasable compiler on the page at [1].
From Borland about Turbo C++
"Turbo C++ version 1 was our first compiler that supported the C++ language. The C++ compiler conformed to AT%26amp;T's 2.0 specification for the C++ language."[3]
It appears the Turbo Debugger is still used on the free Borland C++.
Reply:Turbo C++ is the old Borland C++ compiler!
C++ mutual-inclusion (mutual dependcies)?
Hi all. I am having an issue using Borland C++ Builder where I have 2 classes:
TTarget
TTgtMgr
Both classes include references to the other in the defintions (header) and the implementation (cpp)
I tried using forward declarations. This allows me to make vars
TTarget *tgt
TTgtMgr *mgr
in each others classes, however the problem is, in the implementation, I try to access the methods of the other class and I recieve the following compiler error:
Cannot access methods of %26lt;class%26gt; because %26lt;class%26gt; is not yet defined.
So for example in TTarget.cpp I do:
*TTgtMgr *mgr
mgr-%26gt;someMgrFunc();
And the error occurs.
I feel like some form of late binding might help but I really dont understand it well enough to implement such a fix.
Any thoughts on how I can remedy this problem?
Thanks!
C++ mutual-inclusion (mutual dependcies)?
In the .h files of the above two classes use forward declaration, no "*" required.
In TTarget.h before actual class definitions starts
/////////// TTarget.h file
class TTgtMgr; //forward declaration
class TTarget{
}
/////////// TTgtMgr.h file
class TTarget; //forward declaration
class TTgtMgr{
}
fill in the rest of the implementations
TTarget
TTgtMgr
Both classes include references to the other in the defintions (header) and the implementation (cpp)
I tried using forward declarations. This allows me to make vars
TTarget *tgt
TTgtMgr *mgr
in each others classes, however the problem is, in the implementation, I try to access the methods of the other class and I recieve the following compiler error:
Cannot access methods of %26lt;class%26gt; because %26lt;class%26gt; is not yet defined.
So for example in TTarget.cpp I do:
*TTgtMgr *mgr
mgr-%26gt;someMgrFunc();
And the error occurs.
I feel like some form of late binding might help but I really dont understand it well enough to implement such a fix.
Any thoughts on how I can remedy this problem?
Thanks!
C++ mutual-inclusion (mutual dependcies)?
In the .h files of the above two classes use forward declaration, no "*" required.
In TTarget.h before actual class definitions starts
/////////// TTarget.h file
class TTgtMgr; //forward declaration
class TTarget{
}
/////////// TTgtMgr.h file
class TTarget; //forward declaration
class TTgtMgr{
}
fill in the rest of the implementations
C++: how to create a .lib file?
Hi i have a simple console program done using Borland C++.
How do i cut portions of it and make them into .lib and .h files?
C++: how to create a .lib file?
In Borland, depending on version, there should be a command line tool called TLIB that actually installs the object code and certain parameters into the .lib file for you. As far as I know, you need to do these steps:
1). As posted by others, leave out the main function. Everything that will be called as a library routine should have a function definition ( the complete function ) left in the .c source file.
2). Be sure that all function declarations are put into a header (.h) file and that any included headers are included there also. Be sure that any global variables are either exposed by declaring them as external or transferring them into the source (.c) file.
3). Make sure that all the functions names are unique among standard libraries so there won't be name conflicts later.
4). Compile your two files to object (.obj) files.
5). Instead of linking them with the linker, simply use the TLIB.EXE utility that comes with Borland products to produce the actual library file. Keep a copy of the source! You might want to revise it later.
6.) Optional step: write another project to test calls to each function independant of the original source code, compiling with the appropriate header and library files as options.
I believe that I covered everything. It has been a while since I've written any libraries in C or C++. Hmmm... maybe I'll just do that! Thanks for the idea.
How do i cut portions of it and make them into .lib and .h files?
C++: how to create a .lib file?
In Borland, depending on version, there should be a command line tool called TLIB that actually installs the object code and certain parameters into the .lib file for you. As far as I know, you need to do these steps:
1). As posted by others, leave out the main function. Everything that will be called as a library routine should have a function definition ( the complete function ) left in the .c source file.
2). Be sure that all function declarations are put into a header (.h) file and that any included headers are included there also. Be sure that any global variables are either exposed by declaring them as external or transferring them into the source (.c) file.
3). Make sure that all the functions names are unique among standard libraries so there won't be name conflicts later.
4). Compile your two files to object (.obj) files.
5). Instead of linking them with the linker, simply use the TLIB.EXE utility that comes with Borland products to produce the actual library file. Keep a copy of the source! You might want to revise it later.
6.) Optional step: write another project to test calls to each function independant of the original source code, compiling with the appropriate header and library files as options.
I believe that I covered everything. It has been a while since I've written any libraries in C or C++. Hmmm... maybe I'll just do that! Thanks for the idea.
Do I need C++ turbo to write programs? Can I download this type of program?
I would like Borland c++ version. I think it has Turbo in the name of it. I don't know what to call this type of program though. I'm looking for the program that allows you to write the souce code and then you press execute and it will compile it and run it.
Do I need C++ turbo to write programs? Can I download this type of program?
You can use any IDE. Take a look at Eclipse, which is a free, open source IDE - http://www.eclipse.org/
Reply:No. You can use Notpad for write a program %26amp; just save it with .cpp extention.
Reply:No, you can use any type of C++ compiler.
If I were you I would get Dev-C++;
http://www.bloodshed.net/devcpp.html
florist shop
Do I need C++ turbo to write programs? Can I download this type of program?
You can use any IDE. Take a look at Eclipse, which is a free, open source IDE - http://www.eclipse.org/
Reply:No. You can use Notpad for write a program %26amp; just save it with .cpp extention.
Reply:No, you can use any type of C++ compiler.
If I were you I would get Dev-C++;
http://www.bloodshed.net/devcpp.html
florist shop
Basic C syntax, assigning a value?
I am working with Borland C++ 5.02 compiling a C program to read an INI file with this function prototype:
extern const double readIniDouble( void *fp, const char *section, const char *name, const double defValue );
I can read the value with no problem with this code:
double test;
test = readIniDouble( iniFile, "ASection", "AName", 2 );
cprintf( "%e", test ); // Correctly writes the default value of '2'
The problem is that I need to get the value into a struct:
static struct settings tmp_set;
tmp_set.aSetting = readIniDouble( iniFile, "ASection", "AName", 2 );
cprintf( "%e", %26amp;tmp_set.aSetting ); // does not work
This compiles but prints an unexpected large number. If I use an ampersand or asterisk in front of tmp_set on the left side of the assignment (%26amp;tmp_set.aSetting = ... ) I get a compiler error 'Illegal use of floating point'.
What is the correct syntax to assign the return value of the iniReadDouble() function directly to the struct member?
Basic C syntax, assigning a value?
don't print %26amp;tmp_set.aSetting, just tmp_set.aSetting. With the %26amp;, you're taking the memory address of that variable, not its value.
extern const double readIniDouble( void *fp, const char *section, const char *name, const double defValue );
I can read the value with no problem with this code:
double test;
test = readIniDouble( iniFile, "ASection", "AName", 2 );
cprintf( "%e", test ); // Correctly writes the default value of '2'
The problem is that I need to get the value into a struct:
static struct settings tmp_set;
tmp_set.aSetting = readIniDouble( iniFile, "ASection", "AName", 2 );
cprintf( "%e", %26amp;tmp_set.aSetting ); // does not work
This compiles but prints an unexpected large number. If I use an ampersand or asterisk in front of tmp_set on the left side of the assignment (%26amp;tmp_set.aSetting = ... ) I get a compiler error 'Illegal use of floating point'.
What is the correct syntax to assign the return value of the iniReadDouble() function directly to the struct member?
Basic C syntax, assigning a value?
don't print %26amp;tmp_set.aSetting, just tmp_set.aSetting. With the %26amp;, you're taking the memory address of that variable, not its value.
Sunday, July 12, 2009
Turbo C++! How can i make the char statement recognize two characters at the same time?
This is for my assignment in our basic programming class. we are required to make a program like those in television. Where the computer displays a list of channels then prompts the user to input a channel (it could be a letter or number). then the name of the channel will be displayed on the screen. i used the data type "char" so that i could work on both letters and numbers. but char only recognizes a single character. how can i make "char" recognize two characters on a single variable? by the way i am using borland C++(TURBO C++ IDE) thanks..
Turbo C++! How can i make the char statement recognize two characters at the same time?
I guess you could use either a character array or a string. If you know you only need two characters then I would go with the character array.
char channel[2];
channel[0] = '1';
channel[1] = '0';
element 0 is the first character and element 1 is the second.
Reply:I too would use a char array.
char channel[2];
channel[0] = '1';
channel[1] = '0';
OR
channel[0] = '7';
The use a string array for the channel names
string name [10] will hold an array of 10 strings.
so name[0]='ABC"; etc
Then use the atoi function to change the char array to a number. (atoi is a function that takes a constant char pointer (char array variable) and converts the entire char array to its integer equivalent)
So, if the char array is ['1','0'] it would be 10 in int
Then that 10 can correspond to the 10th index in the string array, which could be whatever, CBS.
Like this
int x = atoi(channel);
String tempName = name[x]; //get the string name
Meaning you have two arrays where there index corresponds to one another.
Turbo C++! How can i make the char statement recognize two characters at the same time?
I guess you could use either a character array or a string. If you know you only need two characters then I would go with the character array.
char channel[2];
channel[0] = '1';
channel[1] = '0';
element 0 is the first character and element 1 is the second.
Reply:I too would use a char array.
char channel[2];
channel[0] = '1';
channel[1] = '0';
OR
channel[0] = '7';
The use a string array for the channel names
string name [10] will hold an array of 10 strings.
so name[0]='ABC"; etc
Then use the atoi function to change the char array to a number. (atoi is a function that takes a constant char pointer (char array variable) and converts the entire char array to its integer equivalent)
So, if the char array is ['1','0'] it would be 10 in int
Then that 10 can correspond to the 10th index in the string array, which could be whatever, CBS.
Like this
int x = atoi(channel);
String tempName = name[x]; //get the string name
Meaning you have two arrays where there index corresponds to one another.
C++ question?
in C++ programming using Borland C++...how do i make a button do 2 alternating tasks each time i click on it?
this are the 2 tasks i want to alternate by clicking the same button...
Shape2-%26gt;Brush-%26gt;Color=clLime;
and this
Shape1-%26gt;Brush-%26gt;Color=clTeal;
C++ question?
col here is your link
http://www.google.co.uk/search?hl=en%26amp;q=m...
this are the 2 tasks i want to alternate by clicking the same button...
Shape2-%26gt;Brush-%26gt;Color=clLime;
and this
Shape1-%26gt;Brush-%26gt;Color=clTeal;
C++ question?
col here is your link
http://www.google.co.uk/search?hl=en%26amp;q=m...
C++ help??
I compile a project its got no errors!
but when running it i get linker errors!
how to solve it?
i use borland c++ and dev c++!
C++ help??
It is impossible to tell without seeing the error but most likely you have a method or static member defined that you did not provide an implementation for. This problem can only be caught at the link stage. Other possible problems are a missing library, the wrong library, or a misdefined remote call.
The compile stage builds the individual pieces. The link stage glues them all together. It is not until the link stage that it can notice that something is missing.
Reply:just go to file save as another filename then compile
most of the time this solves the problem
sympathy flowers
but when running it i get linker errors!
how to solve it?
i use borland c++ and dev c++!
C++ help??
It is impossible to tell without seeing the error but most likely you have a method or static member defined that you did not provide an implementation for. This problem can only be caught at the link stage. Other possible problems are a missing library, the wrong library, or a misdefined remote call.
The compile stage builds the individual pieces. The link stage glues them all together. It is not until the link stage that it can notice that something is missing.
Reply:just go to file save as another filename then compile
most of the time this solves the problem
sympathy flowers
A good C++ compiler?
Hi! I'm quite new to programming in c++ (NOT VISUAL C++) . I am currently working on Borland C++ v3.0 (Dos version). I wanted to know if there is a compiler with similar code but is window based i.e. the IDE for it is a window and not the dos screen for it utilises too much of CPU. Please reply and possibly give a download link for a free compiler of this sort. I'll be grateful...
A good C++ compiler?
Hey...This is the compiler that I had to use in school.
Bloodshed
http://www.bloodshed.net/devcpp.html
Hope that helps :)
Reply:im sorry this isnt an answer but I have no way of reaching you, so Ill do it here, what do you mean by passwording them as I am zipping them not after they are zipped? Care to email me at wangnanininja@yahoo.com in more details? Thank you.
Reply:I use bloodshed Dev C++ and its very efficient. Visit the link below to download it for free:
http://bloodshed.net/dev/devcpp.html
There are about 4 versions of this compiler, I recommend you download version 4.9.9.2 (9.0 MB).
Take care
Reply:I also used Dev C++ and it's simpler than Visual C++. And you don't necessarily have to make a project to include your sources before compiling and building. So if it happens to have just one source you don't have to include it in anything.
Reply:GCC is the best for Linux....try to find dev C++ for windows
Reply:I’m surprised Google isn’t working for you. Or, don’t tell me, as an aspiring programmer, you haven’t learnt to Google yet.
You’ll see two major recommendations over and over, which are good choices for beginners. The first is Visual C++. On a windows PC this is ideal. You can get a free version. Google for Visual C++ Express.
The second is gcc. They make a C++ compiler. The windows version is under the name MinGW. Bloodshed Dev-C++ and many other IDEs use MinGW.
Reply:I Think The Best One For You Is The Borland C++ Builder 6 .... I Think It Works The Same And It's Windows Based But It Isn't Very Strong Compiler I have Worked With It ....... Silly Bugs
Reply:gcc is the best,no doubt.Sticks to the standard ANSI C.
A good C++ compiler?
Hey...This is the compiler that I had to use in school.
Bloodshed
http://www.bloodshed.net/devcpp.html
Hope that helps :)
Reply:im sorry this isnt an answer but I have no way of reaching you, so Ill do it here, what do you mean by passwording them as I am zipping them not after they are zipped? Care to email me at wangnanininja@yahoo.com in more details? Thank you.
Reply:I use bloodshed Dev C++ and its very efficient. Visit the link below to download it for free:
http://bloodshed.net/dev/devcpp.html
There are about 4 versions of this compiler, I recommend you download version 4.9.9.2 (9.0 MB).
Take care
Reply:I also used Dev C++ and it's simpler than Visual C++. And you don't necessarily have to make a project to include your sources before compiling and building. So if it happens to have just one source you don't have to include it in anything.
Reply:GCC is the best for Linux....try to find dev C++ for windows
Reply:I’m surprised Google isn’t working for you. Or, don’t tell me, as an aspiring programmer, you haven’t learnt to Google yet.
You’ll see two major recommendations over and over, which are good choices for beginners. The first is Visual C++. On a windows PC this is ideal. You can get a free version. Google for Visual C++ Express.
The second is gcc. They make a C++ compiler. The windows version is under the name MinGW. Bloodshed Dev-C++ and many other IDEs use MinGW.
Reply:I Think The Best One For You Is The Borland C++ Builder 6 .... I Think It Works The Same And It's Windows Based But It Isn't Very Strong Compiler I have Worked With It ....... Silly Bugs
Reply:gcc is the best,no doubt.Sticks to the standard ANSI C.
C++ Simple phone book?
a c++ Simple phone book source code THAT write data on A file and realy work with borland c++.
thank you
C++ Simple phone book?
Try this:
http://www.solomediaworks.com/personal/v...
thank you
C++ Simple phone book?
Try this:
http://www.solomediaworks.com/personal/v...
Can i learn C# before Visual C++ ?
i learned everything in the old borland C++ and i'm about to start learning C# from point zero , so is it OK to do so without learning C++ ? ....
Can i learn C# before Visual C++ ?
If you do not have little bit knowledge of object oriented programming, you may find it difficult to pick up, anyway best of luck
Reply:I heard you can learn C# if you know VB.
Can i learn C# before Visual C++ ?
If you do not have little bit knowledge of object oriented programming, you may find it difficult to pick up, anyway best of luck
Reply:I heard you can learn C# if you know VB.
Is it normal for my c++ software to get my processor working at full power?
I have the Borland C++, and because of the heat the processor goes over the hedge. When I start the IDE the processor climbs up to 60 Celsius and then the Windows give's me the blue screen. Is it normal for C++ to put this much presure on my cpu? I have a AMD Athlon 3500+/ 2 Gb Ram/ Asus Mb. So the system is not a weak one. The borland software has been used by my highscholl for about 15 years, from my teacher I got it to work at home. Could the problem be that the software is too old?
Is it normal for my c++ software to get my processor working at full power?
The IDE is sitting on a 'busy-wait', the application seems to be that old!
http://en.wikipedia.org/wiki/Busy-wait
Run it in Dos-Box, that will regulate the speed.
http://dosbox.sourceforge.net
Or you could use a newer IDE instead. Your C++ compiler should still work, but it's really old, and your programs will suffer the same fate as the IDE!
This is the best free IDE/GNU G++ based C++ tool chain I can find:
http://www.bloodshed.net/dev/
About the compiler:
http://en.wikipedia.org/wiki/G%2B%2B
(Dev-C++ uses the GNU compilers, it's used to compile most Open Source applications, including some Operating Systems! It will also use the features of your processor, where the old Borland compiler wont - a new Borland compiler will of course. To find out why the IDE failed, look into the following functions - sleep, and usleep! - have fun!)
Should you want to experiment with C++ outside of windows I recommend:
http://www.ubuntu.com
Reply:Borland C++ consuming too much CPU on a 2gig Box, amazing!
I guess the SW is corrupt. Why dont you re-install Borland C++ and try again?
Get the latest Borland C++ SW. If you are using the old one (from your school days), its designed for DOS and 80*88 processors. That should be the problem.
Alternately, you can run the C++ IDE (If it is DOS based) in command window launched by "cmd" command - not "command" command. Try this.
Reply:The only thing I can think of is that you're running a console application in DOS. To deal with that use DOSBox or something similar to underclock your machine. Seems odd though!
bridal flowers
Is it normal for my c++ software to get my processor working at full power?
The IDE is sitting on a 'busy-wait', the application seems to be that old!
http://en.wikipedia.org/wiki/Busy-wait
Run it in Dos-Box, that will regulate the speed.
http://dosbox.sourceforge.net
Or you could use a newer IDE instead. Your C++ compiler should still work, but it's really old, and your programs will suffer the same fate as the IDE!
This is the best free IDE/GNU G++ based C++ tool chain I can find:
http://www.bloodshed.net/dev/
About the compiler:
http://en.wikipedia.org/wiki/G%2B%2B
(Dev-C++ uses the GNU compilers, it's used to compile most Open Source applications, including some Operating Systems! It will also use the features of your processor, where the old Borland compiler wont - a new Borland compiler will of course. To find out why the IDE failed, look into the following functions - sleep, and usleep! - have fun!)
Should you want to experiment with C++ outside of windows I recommend:
http://www.ubuntu.com
Reply:Borland C++ consuming too much CPU on a 2gig Box, amazing!
I guess the SW is corrupt. Why dont you re-install Borland C++ and try again?
Get the latest Borland C++ SW. If you are using the old one (from your school days), its designed for DOS and 80*88 processors. That should be the problem.
Alternately, you can run the C++ IDE (If it is DOS based) in command window launched by "cmd" command - not "command" command. Try this.
Reply:The only thing I can think of is that you're running a console application in DOS. To deal with that use DOSBox or something similar to underclock your machine. Seems odd though!
bridal flowers
For C language programmers that also know Linux...?
Does Linux (for instance Fedora Core 5) provide a good IDE for C language programing? One that you personally used and liked. One that you can say it is good.
I already have Fedora Core 5 installed on my PC, but I don't know where to look for a C language IDE in this version of Linux.
I am also a quite bad user of Fedora Core 5 (I mean I don't know how to set up an ethernet card, or an internet connection... the installation does it automatically... or I don't know how to mount my HDD without looking at something I wrote in the past about this... or other stupid things that Linux makes you to learn...)
I need DEBUGGING immediately... I have an old Borland C 3.1, and in WinXP it says it can't start the debugging section of the IDE on 16 bits... It can only edit and compile, but no debugging, unfortunately...
What to do?
For C language programmers that also know Linux...?
Anjuta is the best IDE available.
It works pretty well.
For debugging you can use gdb also(if you don't mind working on the console)
Reply:Linux doesn't support IDE version of C, it has in-built GCC compiler. (Though I've RedHat platform, not Fedora). You can partition your HD to accomodate both Windows and Linux both operating systems in your computer. Then install Turbo C++ IDE in Windows part .
Reply:"Does Linux (for instance Fedora Core 5) provide a good IDE for C language programing?"
There's a few IDEs that run on Linux. http://en.wikipedia.org/wiki/List_of_int... gets you a list of IDEs. KDevelop and Anjuta, and I think Code::Blocks are usable on Linux. It's also not uncommon to see people prefer to use a plain text editor and use commandline/makefiles for compiling and linking.
The compiler on Linux is gcc and g++ (for C and C++). The debugger that goes with gcc is gdb.
I already have Fedora Core 5 installed on my PC, but I don't know where to look for a C language IDE in this version of Linux.
I am also a quite bad user of Fedora Core 5 (I mean I don't know how to set up an ethernet card, or an internet connection... the installation does it automatically... or I don't know how to mount my HDD without looking at something I wrote in the past about this... or other stupid things that Linux makes you to learn...)
I need DEBUGGING immediately... I have an old Borland C 3.1, and in WinXP it says it can't start the debugging section of the IDE on 16 bits... It can only edit and compile, but no debugging, unfortunately...
What to do?
For C language programmers that also know Linux...?
Anjuta is the best IDE available.
It works pretty well.
For debugging you can use gdb also(if you don't mind working on the console)
Reply:Linux doesn't support IDE version of C, it has in-built GCC compiler. (Though I've RedHat platform, not Fedora). You can partition your HD to accomodate both Windows and Linux both operating systems in your computer. Then install Turbo C++ IDE in Windows part .
Reply:"Does Linux (for instance Fedora Core 5) provide a good IDE for C language programing?"
There's a few IDEs that run on Linux. http://en.wikipedia.org/wiki/List_of_int... gets you a list of IDEs. KDevelop and Anjuta, and I think Code::Blocks are usable on Linux. It's also not uncommon to see people prefer to use a plain text editor and use commandline/makefiles for compiling and linking.
The compiler on Linux is gcc and g++ (for C and C++). The debugger that goes with gcc is gdb.
C++ environment for mandriva?
i've been stuck on finding the solution of this problem :
before this, i use borland C++ 5.2 under XP, however now i used linux mandriva 2007.1 one spring. the quiestion is, what is an equivalent software to my previous compilers. I've used Kdevelop but found myself stuck to make a console application. Someone please help me. I also used WINE to run that borland. But the application won't appear when i tried to run it under mandriva.
C++ environment for mandriva?
everything's already there.
create a file called i.e. test.cpp, then compile it in a console:
g++ test.cpp -o test
now you can start it with
./test
if you omit the parameter "-o test", then the created file is called a.out.
before this, i use borland C++ 5.2 under XP, however now i used linux mandriva 2007.1 one spring. the quiestion is, what is an equivalent software to my previous compilers. I've used Kdevelop but found myself stuck to make a console application. Someone please help me. I also used WINE to run that borland. But the application won't appear when i tried to run it under mandriva.
C++ environment for mandriva?
everything's already there.
create a file called i.e. test.cpp, then compile it in a console:
g++ test.cpp -o test
now you can start it with
./test
if you omit the parameter "-o test", then the created file is called a.out.
What is difference between c++ & embedded c++, do they require different version of C++ for prog. execution?
i know a bit of embedded %26amp; assembly language,but still dont know difference between c++ %26amp; embedded c++. i have a progg in c++ for serial communication but now i dont know whether i have to run it on normal (borland) c++ or it require some other version of c++.plz do tell me the source if it require some other version
What is difference between c++ %26amp; embedded c++, do they require different version of C++ for prog. execution?
They are basically the same as far as language goes. The biggest difference is going to be the compiler and operating system. If you have a serial communications module written for an embedded processor, it probable wont work on your desktop/laptop, or the other way around. Mostly because of the operating system used on each.
What is difference between c++ %26amp; embedded c++, do they require different version of C++ for prog. execution?
They are basically the same as far as language goes. The biggest difference is going to be the compiler and operating system. If you have a serial communications module written for an embedded processor, it probable wont work on your desktop/laptop, or the other way around. Mostly because of the operating system used on each.
C++ programming, Error E2194; could not find file hello.cpp?
I am trying to run a simple program and I've installed Borland C++ compiler for free on my computer. The code is supposed to simply write Hello World, on the screen in the command prompt box. The book I have tells me to type in bcc32 hello.cpp into the command prompt box to run the program, but I get the error message. It recognizes the bcc32 command, but then runs the E2194 message. I had to change the path in environment variables first since the bcc32 was not recognized at first, but after changing the path, this works. I have also created the two necessary text files bcc32.cfg and ilink32.cfg. The path is c:\Borland\Bcc55\Bin. I have the hello.cpp program in what I think is the right spot, but it seems to not be able to find it. Can anyone help me. I need to know how to tell the computer or program where to "look" for this file.
C++ programming, Error E2194; could not find file hello.cpp?
Borland is outdated!
Get a better compiler, like Dev-C++ (it's free, see sources).
Once you've installed it, click File (toolbar) %26gt; New %26gt; Project...
From there it'll give you a few program types.. (you can click the 'Introduction' tab for the Hello World example).
Have fun,
Dys.
Reply:dys is right you know dev-c++ rocks
wedding reception flowers
C++ programming, Error E2194; could not find file hello.cpp?
Borland is outdated!
Get a better compiler, like Dev-C++ (it's free, see sources).
Once you've installed it, click File (toolbar) %26gt; New %26gt; Project...
From there it'll give you a few program types.. (you can click the 'Introduction' tab for the Hello World example).
Have fun,
Dys.
Reply:dys is right you know dev-c++ rocks
wedding reception flowers
C++, can't see a file, very simple question?
I am trying to run a simple program and I've installed Borland C++ compiler for free on my computer. The code is supposed to simply write Hello World, on the screen in the command prompt box. The book I have tells me to type in bcc32 hello.cpp into the command prompt box to run the program, but I get the error message. It recognizes the bcc32 command, but then runs the E2194 message. I had to change the path in environment variables first since the bcc32 was not recognized at first, but after changing the path, this works. I have also created the two necessary text files bcc32.cfg and ilink32.cfg. The path is c:\Borland\Bcc55\Bin. I have the hello.cpp program in what I think is the right spot, but it seems to not be able to find it. Can anyone help me. I need to know how to tell the computer or program where to "look" for this file.
C++, can't see a file, very simple question?
If configured correctly, it should be looking for the hello.cpp file in the current directory. If not, try fully qualifying the program, that is:
bcc32 c:\blahblahblah\hello.cpp
If that works, then you've got a configuration issue. Something should be set to check the current path first.
C++, can't see a file, very simple question?
If configured correctly, it should be looking for the hello.cpp file in the current directory. If not, try fully qualifying the program, that is:
bcc32 c:\blahblahblah\hello.cpp
If that works, then you've got a configuration issue. Something should be set to check the current path first.
Subscribe to:
Posts (Atom)