Forum: C May 5th, 2009 |
| Replies: 20 Views: 2,141 hi all.
i have read a text line from a file using fgets() into a char array char astr[30]
then i did strcat(astr,"secondstring")
The output of printf (astr) is appearing on 2 lines instead... |
Forum: C Mar 24th, 2009 |
| Replies: 7 Views: 539 Thanks for advising Ancient Dragon. |
Forum: C Mar 23rd, 2009 |
| Replies: 7 Views: 539 thanks nucleon & Ancient Dragon.
I modified the way the program will be running.It will run in the background so no output will be visible to the console.
I want to use the kill command &... |
Forum: C Mar 19th, 2009 |
| Replies: 7 Views: 539 hi everyone.
my program uses an infinite loop & runs forever.
i want to run some codes when i decide to stop the program using CTRL-C.
Is this possible ? Please advise me.
thanks |
Forum: C Feb 6th, 2009 |
| Replies: 14 Views: 1,225 hi .
i managed to find the bug. now it's not crashing.
thanks.
Btw i will use use code tags next time :) |
Forum: C Feb 5th, 2009 |
| Replies: 14 Views: 1,225 |
Forum: C Feb 4th, 2009 |
| Replies: 14 Views: 1,225 hi everyone.
i modified me_ansh code and its working.
The problem is that when it reaches the last line the program crashes
(segmentation fault)
Plz help.
thx
My implementation: |
Forum: C Jan 23rd, 2009 |
| Replies: 14 Views: 1,225 thx for the code.
but because there is an infinite loop cpu usage is 100%.
do you know how to prevent this ? |
Forum: C Jan 21st, 2009 |
| Replies: 14 Views: 1,225 does fgets() gets aware when a file is updated ?
will clearerr( fp ) tell fgets() that EOF has not been reached? |
Forum: C Jan 21st, 2009 |
| Replies: 14 Views: 1,225 i tried it. its not working. |
Forum: C Jan 20th, 2009 |
| Replies: 14 Views: 1,225 Hi.
am using fgets() to read lines from a text file.
the file is being updated after a few seconds.
i want to read and process the last appended line at the end of the file.
i tried the... |
Forum: C Jan 6th, 2009 |
| Replies: 2 Views: 950 OK.
Thanks for the suggestion. |
Forum: C Jan 6th, 2009 |
| Replies: 2 Views: 950 hi .
i have read a line from a text file & stored it in a string using fgets().
the file contains the following line:
C:\Windows\
char myline[20];
fgets(myline,20,fp); |
Forum: C Dec 16th, 2008 |
| Replies: 5 Views: 1,395 its not that i think. i had put a semi-colon there. |
Forum: C Dec 16th, 2008 |
| Replies: 5 Views: 1,395 about the warning am saying. any idea ? |
Forum: C Dec 16th, 2008 |
| Replies: 5 Views: 1,395 plz explain how to do this the proper way.
main.c
=====
struct names{ // definitions
-----
----
----
} |
Forum: C Dec 16th, 2008 |
| Replies: 11 Views: 972 ok. plz give an overview.
the sequence of steps i mean.
is my understanding correct ?
while(1){
if fgets == NULL{
sleep
clearerr
} |
Forum: C Dec 15th, 2008 |
| Replies: 11 Views: 972 ok will do that.
instead of making the program sleep, will it be ok to check everytime in an infinite loop for the following:
if fgets is not null -> read & process |
Forum: C Dec 15th, 2008 |
| Replies: 11 Views: 972 i tried this piece of code:
while (1)
{
fgets(buffer,1024,myfile);
printf("%s\n",buffer);
}
the prob is that wen it reaches the end of file , it keeps on printing the... |
Forum: C Dec 15th, 2008 |
| Replies: 11 Views: 972 will implement in C.
cant we make the fgets() wait until the updater writes some new line ? |
Forum: C Dec 15th, 2008 |
| Replies: 11 Views: 972 yes , it keep trying to read in case the updater puts more data into the file.
reader should stop reading the file once a date & time criteria is met. |
Forum: C Dec 15th, 2008 |
| Replies: 11 Views: 972 hi.
actually i hv to read lines from a file which is getting updated at the same time( new lines are appended at the end of the file).
plz suggest a way to implement it in c.
thx. |
Forum: C Dec 9th, 2008 |
| Replies: 7 Views: 1,895 thx for the code , but i wanted to read & store each of the hex values (e.g 54 - hex of T) in 1 char so that when i print the char it gives me back T as output. |
Forum: C Dec 9th, 2008 |
| Replies: 7 Views: 1,895 the 0x part must be removed or not ?
u said for scanf() reads the prefix. |
Forum: C Dec 9th, 2008 |
| Replies: 7 Views: 1,895 ok let me simplify the problem.
0x54 is hex of T.
If u run the following it prints "x= T" on the screen.
char x;
x=0x54;
printf("x = %c\n",x);
now the prob is if u already have... |
Forum: C Dec 5th, 2008 |
| Replies: 7 Views: 1,895 hi all.
the following is working fine for me
char * hex = (..dynamically allocated memory with malloc..);
*(hex+0) = 0x43;
*(hex+1) = 0x2b;
i now have to assign a string in the format 43... |
Forum: C Nov 24th, 2008 |
| Replies: 4 Views: 586 thx Narue.
Bt any algo to decrypt file if dnt know how it was encrypted ?
Is it possible to convert it completely to ascii ?
Aim is to extract info from encrypted files.
plz guide Narue. |
Forum: C Nov 21st, 2008 |
| Replies: 4 Views: 586 hi. plz help with reading encrypted binary files in C.
thx. |
Forum: C Nov 20th, 2008 |
| Replies: 0 Views: 602 hi !
does anyone know how to install & use the perl compatible regex (PCRE) api in Bloodshed Dev++ ? |
Forum: C Nov 20th, 2008 |
| Replies: 4 Views: 2,434 |
Forum: C Nov 19th, 2008 |
| Replies: 4 Views: 2,434 hi ArkM. am using PCRE C API.
but am getting error when i pass a pattern as a parameter. can u help?
pattern is "/\d\d/"
error : unknown escape sequence '\d'
thx |
Forum: C Nov 14th, 2008 |
| Replies: 4 Views: 2,434 hi . can someone plz explain how to do regex in C.
input: a text file.
aim: read each line from the text & check if a RegEx pattern exists. finally return that pattern if it exists.
plz share... |