Hi,
What are projects to be made if I added a native .C file to empty project and want to build .lib file which will be linked with CPP project with /clr option to build .exe ??
But my native code is giving basic errors like,
it is not even compiling this code ..
..
int g = 1;
g++;
....
compiler is giving error as
Error C2105: '++' needs l-value
///HERE is whole code starts
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<ctype.h>
int ch;
char Y_N;
void EASY()
{
int colr, arr, i,j,r, b[6];
char col[]={'R','Y','BG','B','P','G'};
clrscr();
textcolor(25);
gotoxy(3,5);
cprintf("Guess the hidden codes\n");
gotoxy(3,6);
cprintf("You only have fourteen tries.\n");
showcolors();
for(i=0;i<6;i++)
{
int r=rand()%sizeof(col);
printf("%c ",col[r]);
}
printf("\n");
for(i=1;i<=14;i++)
{printf("\nGuess No. [%d]: ",i);
for(j=0;j<6;j++)
{scanf("%d",&b[j]);
{if(col[0]==b[0])
arr++;
else
if(col[1]==b[1])
col++;
else
if(a[0]==b[2])
col++;
else
if(a[0]==b[3])
col++;
else
if(a[0]==b[4])
col++;
else
if(a[0]==b[5])
col++;}
{if(a[1]==b[1])
arr++;
else
if(a[1]==b[0])
col++;
else
if(a[1]==b[2])
col++;
else
if(a[1]==b[3])
col++;
else
if(a[1]==b[4])
col++;
else
if(a[1]==b[5])
col++;}
{if(a[2]==b[2])
arr++;
else
if(a[2]==b[0])
col++;
else
if(a[2]==b[1])
col++;
else
if(a[2]==b[3])
col++;
else
if(a[2]==b[4])
col++;
else
if(a[2]==b[5])
col++;}
{if(a[3]==b[3])
arr++;
else
if(a[3]==b[0])
col++;
else
if(a[3]==b[1])
col++;
else
if(a[3]==b[2])
col++;
else
if(a[3]==b[4])
col++;
else
if(a[3]==b[5])
col++;}
{if(a[4]==b[4])
arr++;
else
if(a[4]==b[0])
col++;
else
if(a[4]==b[1])
col++;
else
if(a[4]==b[2])
col++;
else
if(a[4]==b[3])
col++;
else
if(a[4]==b[5])
col++;}
{if(a[5]==b[5])
arr++;
else
if(a[5]==b[0])
col++;
else
if(a[5]==b[1])
col++;
else
if(a[5]==b[2])
col++;
else
if(a[5]==b[3])
col++;
else
if(a[5]==b[4])
col++;}
gotoxy(60,11);
printf("Arrangements: %d\tColors: %d",arr,col);
{if(arr==6)
i=15;
printf("You have decoded the code. Congratulations!");}
}}
}
showcolors()
{
gotoxy(3,8);
printf("Colors are: ");
gotoxy(3,9);
textcolor(RED);
cprintf("[R]Red");
gotoxy(11,9);
textcolor(3);
cprintf("[BG]BlueGreen");
gotoxy(26,9);
textcolor(YELLOW);
cprintf("[Y]Yellow");
gotoxy(37,9);
textcolor(GREEN);
cprintf("[G]Green");
gotoxy(47,9);
textcolor(9);
cprintf("[B]Blue");
gotoxy(56,9);
textcolor(5);
cprintf("[P]Purple");
printf("\n");
}
main()
{
clrscr();
printf("MASTERMIND GAME\n\n");
printf("Choose Difficulty\n[1] EASY\n[2] NORMAL\n[3] HARD\n\n");
printf("Your Choice: ");
scanf("%d",&ch);
if(ch==1)
EASY();
else
if(ch==2)
printf("*");
else
if(ch==3)
printf("*");
else
printf("\nWRONG KEY!");
getch();
}
////---------------------- C code ends
Please help !!!!!