String in Borland c++ v5.5

March 6, 2011 at 06:14:17
Specs: Windows XP
Hey I need help with "string" in c++. I'm using borland c++ v5.5. when I initialize string it gets and error of "Declaration syntax error" on the line. Eventhough I already included the string.h header. And the ".h" in "string.h" is not the problem, this compiler uses .h's on headers. nvm the rest of the code. Sorry for the noob question.
#include <stdio.h>
#include <conio.h>
#include <string.h>

int intro(void);
int choose(void);
int brief;
int z,x,n,caze;
string choice; //<---------here

int main(){

if( brief > 22 || brief < 1)
printf("Invalid briefcase");

return 0;

int intro()
printf("You are playing Deal or no deal.");
printf("\nPick a briefcase from 1 to 22: ");
scanf("%d", &brief);

int choose()
for (z=1;z<=6-n;z++)
printf("Choose your no.%d briefcase you want to open: ",z);
if(caze == case[x])
printf("Briefcase has already been opened");
printf("\nDeal or NO DEAAALL?!\n");
if (choice == "deal")
printf("You have won the banker's offer");
else if (choice == "nodeal")

See More: String in Borland c++ v5.5

March 6, 2011 at 09:21:24
Make sure you're using the correct string library. C has its own string library, string.h (or cstring in modern compliers), and you're probably pulling that one instead of the C++ string library (typically string).

How To Ask Questions The Smart Way

Report •
Related Solutions

Ask Question