Turbo C/C++ and other junk compilers help, discussions and queries here

crazybutt

Broken In
Tc++

well guyz .... i have turbo c installed on my sys wid win XP an wen i try to quit the tc window .........
d monitor just shows a black screen an i am stuck wid it. No attempt to come back to d desktop works... altho d comp is still runnin i.e i can still perform tasks using my keyboard but i cant see anythin on d monitor... i even tried reinstalling but d same problem started to occur after a few dayz of normal working
Plz help........i hav an assgnmt to do an am stuck wid dis problem!!!
 

Jags

Journeyman
dont quit the tc window....

instead use ALT+TAB to get to windows and then right click o the tc window to close it

this is a workaround.. and it does...work-around! :p

do remember to delete files with SWP extension in the TC folder though... as an abnormal termination leaves them there
 

crazybutt

Broken In
but even if i alt-tab a) it still consumes 99% of CPU time and b)i will eventually hav to restart..............isnt dere a way to correct it somehow??
 

siriusb

Cyborg Agent
crazybutt said:
but even if i alt-tab a) it still consumes 99% of CPU time and b)i will eventually hav to restart..............isnt dere a way to correct it somehow??
For the CPU consumption, try this: Create a batch file (.bat extension) and put this in it:
Code:
start /belownormal pathToTC++
Use this bat file to start TCpp and ntvdm will no longer hang the other processes.
 

mohit sharma

Journeyman
turbo c++ compilers consumes a lot of cpu time , i always change it's priority using windows task manager and then i can listen music seamlessly , doing programming
lol
 

jitu_mania

Photoshopgyan.co.cc
borland c and borland c++ to make my projects of my school's

borland c and borland c++ to make my projects of my school's course. from where i can download these programs
 

sakumar79

Technomancer
Dont think Borland C/C++ is available for free download, but you can use Dev C++ from *www.bloodshed.net/devcpp.html which is a free C++ IDE with Mingw port of GCC (GNU Compiler Collection) as it's compiler

Arun
 

NikhilVerma

Padawan
Old is gold says us... :p

A much better option than the 178MB C builder is the 4MB TC...
And he wants to make projects for the school so he'd better use TC coz most of the schools have TC installed...

But I think you should use Dev C++ ...
 

navjotjsingh

Wise Old Owl
Simple C++ Query

Code:
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>
void main()
{
  clrscr();
  char inp[4], out[4];
  int i, len, k;
  cout<<"\n\n-----PROGRAM TO PERFORM POLYALPHABETIC ENCRYPTION-----\n\n";
  cout<<"\nENTER THE STRING TO BE ENCRYPTED: ";
  gets(inp);
  len=strlen(inp);
  for(i=0;i<=len-1;i++)
    out[i] = (int)inp[i] + i + 1;
  cout<<"\n\nTHE ENCRYPTED CIPHER TEXT IS: ";
  puts(out);
  getch();
  return;
}

I tried the above program but the output comes like this

Code:
-----PROGRAM TO PERFORM POLYALPHABETIC ENCRYPTION-----

ENTER THE STRING TO BE ENCRYPTED: DEAR

THE ENCRYPTED CIPHER TEXT IS: EGDVDEAR

The above prgram encrypts like adding position of alphabet in input to its ascii code. DEAR should give EGDV as output.

It always takes length of out string as greater than 4. Strlen on inp always gives 4 but strlen on out gives 8 in this case and on changing 4 to 10 strlen on out increases to 14 also. Why does not length of out remains 4 as specified?

Please Help Me Urgently.........
 

goldberg2k5

Right off the assembly line
I think its the encryption logic fault. Since you are encrypting the whole string upto length (0 to len-1) therefore in effect you are also encrypting the null terminating character '/0'. Jst add '/0' after len amount of characters in the encoded out array and i think it will give the correct answer.

Also i can't figure out how the strlen is giving the correct answer for the inp array since u gave input as DEAR(4 character) there's no room left for the null terminating character. Make sure you check the bounds for input coz it might not work when strings are long!!!!.

I'm not an expert on this and i may be wrong but give it a thought!
 

NikhilVerma

Padawan
Code:
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>
void main()
{
  clrscr();
  char inp[4], out[4];
  int i, len, k;
  cout<<"\n\n-----PROGRAM TO PERFORM POLYALPHABETIC ENCRYPTION-----\n\n";
  cout<<"\nENTER THE STRING TO BE ENCRYPTED: ";
  gets(inp);
  len=strlen(inp);
  for(i=0;i<=len-1;i++)
    out[i] = (int)inp[i] + i + 1;
  out[i]=NULL;
  cout<<"\n\nTHE ENCRYPTED CIPHER TEXT IS: ";
  puts(out);
  getch();
  return;
}


UJLW TJRYQJ IGOT ZQX EGDV ;)
 

navjotjsingh

Wise Old Owl
Biggest Problem for me is that same program worked for me on College PC but not working on my home PC. Also I made the length small as with initial length kept at 100 gave such type of output

DCGV@# !....DEAR

Null character is always after len not include in len of string if I got my basics right.
 

sujithtom

Ambassador of Buzz
First of all assign the arrays some initial values. Secondly check your complier with the one u use in our college.
 

satbir

Broken In
hey your logic is quite ok........... no probs what so ever................. i think the prob lies in the puts function....... i even tried fflush functions to clear the memory but it doesn't work.........i'll try it again .......... in the meanwhile y don't u use an alternative for the puts function.............. this proggy is workin fine

#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>
void main()
{
clrscr();
char inp[4], out[4];
int i, len, k;
cout<<"\n\n-----PROGRAM TO PERFORM POLYALPHABETIC ENCRYPTION-----\n\n";
cout<<"\nENTER THE STRING TO BE ENCRYPTED: ";
gets(inp);
len=strlen(inp);
for(i=0;i<=len-1;i++)
out = (int)inp + i + 1;
cout<<"\n\nTHE ENCRYPTED CIPHER TEXT IS: ";
for(i=0;i<len-1;i++)
cout<<out;
getch();
}


we use retuern only in case of an in main function............ void function is by default empty so it needn't return any value............ u can skip that
 

amitsaudy

Ambassador of Buzz
If hes in school then he should use the msdos based
TC.
Dev CPP is great but for a newbee it can be a little confusing.
 
Top Bottom