168 Posted Topics

Member Avatar for neknek
Member Avatar for ssharish2005
0
109
Member Avatar for Vao
Member Avatar for ssharish2005
0
153
Member Avatar for fishwater00

[code="c"] #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <time.h> typedef struct { int *array; } MODEL; int main() { MODEL *node; int index; srand( time(0) ); if( ( node = malloc( sizeof( MODEL ) ) ) == NULL ) { perror("malloc"); return 1; } else { printd("1. Node creation successful\n"); …

Member Avatar for fishwater00
0
155
Member Avatar for champnim

ohhh man, it is so difficult to go through your code man. It need to really concentrate on how to indent your code. Give some spacing between instruction and it so compack. And your comments, just makes the code really hard to read. Do some work on it, i will …

Member Avatar for champnim
0
651
Member Avatar for Clockowl

It would have been more nice, to see what problem you had. May be we could learn more from that as well. Please do post the problem and the solution you came your problem. You might get some more help and perhaps some feedback on your solution. NOTE: If you …

Member Avatar for Clockowl
0
70
Member Avatar for champnim

champnim, I suspect the problem might be when you free the node which wanted to delete. Perhaps, the memory leak. Do you know the abc char ptr which you have in your node, that needds to be freed as well, before you free temp!!! ssharish

Member Avatar for LouPascalou
0
141
Member Avatar for fishwater00

[code] a(domain); [/code] should be [code] a(Domain); [/code] And main should return 0 on successful return. Perhaps it internally does so. But its good practice to specify them explicitly. ssharish

Member Avatar for fishwater00
0
257
Member Avatar for nishanthaMe

well, this question donst even make any sense, how will we know what IP and the port address you URL uses. when you enter your URL that get resolved y your DNS. If you are looking for the IP address ofthta url, try pinging to that url you will get …

Member Avatar for jephthah
0
63
Member Avatar for Dionysus
Member Avatar for inventer

For me the code works fine, with some minor changes in it. But the code it self is working ok except the integer size. Since you are using turbo C compile which is a 16 bit compiler, the integer size is smaller than ity should be, and that the reason …

Member Avatar for ssharish2005
0
244
Member Avatar for chandra1186

The easy was undersatnding the function is, by think of something like this well. If you have huge lot of code in main, then its a vewry bad programming practice. It is very important that we think before we code it. As said before, if you a huge main function, …

Member Avatar for ssharish2005
0
245
Member Avatar for barbiegirl

As it’s been previously mentioned that, there are quite a few problems in your code. Which you might have to sit down and think about. I will point you out few error which you have made. 1.The memory allocation for char point word is not right. [code] Char (*word)[30]; Has …

Member Avatar for barbiegirl
0
115
Member Avatar for sivakrishna

hahaha here we go a homewok thread again. SivaKrishana show us a snap or some of your code, that way you might get some more help. Luckychap had shown some code, which is some thing very important for your application. Have a look at it. ssharish

Member Avatar for ssharish2005
-1
172
Member Avatar for danibootstrap

Have a look at this tutorial[URL="http://msdn2.microsoft.com/en-us/library/ms810467.aspx"] Serial Programming [/URL]and [URL="http://ontrak.net/mfc.htm"]this[/URL] as well. ssharish

Member Avatar for danibootstrap
0
3K
Member Avatar for savio_1987

[QUOTE=savio_1987;508540]sorry for being so vague, but i am just starting with this and this is my first project, well i am using turbo C version 3 and i am developing for windows XP thanks[/QUOTE] Well, Turbo C compiler o more supported. Try think of changing to a new compiler. Like …

Member Avatar for WaltP
0
203
Member Avatar for pdwivedi

According to your subject title what i can understand is that u are trying to read data from serial and redirect it top PS/2. Well, PS/2 are basically used for input devices, and perhaps if u wanted to read anything from there, u just access it through stdin standard input …

Member Avatar for Ancient Dragon
0
184
Member Avatar for pprabhakar

Compiler flag are not there to use randomly, they should used according to the requirment. Use the main page to get the complete list of compiler flags wiht the brief expplaination of it. Some of the common one used is -Wall -W -ansi -O<x> -o -g -c -I. ssharish

Member Avatar for Salem
0
231
Member Avatar for AbberLine

Well, C supports in multi threading. But before i can say anything about light weight process. I should ask you which OS and compiler are you using. If you are on Linux, you should looking at something called pthread library. ssharish

Member Avatar for AbberLine
0
387
Member Avatar for carobee

on what i know so far, u cant update the contents directly on to the file (well perhaps u can). Perhaps what i would suggest is read each line from the source file into a string. i.e line by line. See if u need to make some changes in that …

Member Avatar for ssharish2005
0
140
Member Avatar for sa-al

OK, what you wanted to really do is to accept a infix express and then convert them into reverse polish express and then evaluate the express. This is achieves using stack and Q's concept in data structures. Have you done data structure before. Get a data structure book and see …

Member Avatar for ssharish2005
0
89
Member Avatar for n.aggel

YES, it does say to prototype there [QUOTE]get_current_dir_name(), which is only prototyped if _GNU_SOURCE is defined[/QUOTE] [url]http://linux.die.net/man/3/get_current_dir_name[/url] ssharish

Member Avatar for ssharish2005
0
650
Member Avatar for zawpai

What is your hardware, where is it connected, how much memory does it have? ssharish

Member Avatar for ssharish2005
0
118
Member Avatar for jobs

What you are after is something smilier to this. [code] char Buffer[20]; int count = 10; sprintf(Buffer, "my_id_%d_", count); [/code] To be more safer on hand use snprintf, if you are worried about overflow and all. Do the same for your send concatenation. The above is just an sample code …

Member Avatar for ssharish2005
0
116
Member Avatar for Jishnu

Cant you use ifndef-else-endif directives? EDIT: Run time, i wonder you could. ssharish

Member Avatar for Jishnu
0
356
Member Avatar for jobs

Something like this [code] #include <stdio.h> #include <stdlib.h> int main() { FILE **fp; char filename[20]; int i; fp = malloc( sizeof(FILE *) * 10); if( fp != NULL ) { for(i=0; i<10; i++) { sprintf(filename, "%s%d.txt", "file",i+1); if( ( fp[i] = fopen(filename, "a+") ) == NULL ) { printf("Error: File …

Member Avatar for Jishnu
0
915
Member Avatar for jobs

The normal approach for this problem is to read 4 lines and then read 5th line and again read 4 lines and then read the 5th line and so on. You could even use fseek but the problem with that is you should be having the right offset value. In …

Member Avatar for yagiD
0
108
Member Avatar for jobs

perhaps look at this one as well. [code] #include <stdio.h> int main() { int a[10]; int *a1; printf("%d\n", sizeof(a)); printf("%d\n", sizeof(a1)); getchar(); return 0; } /* my output 40 4 */ [/code] Ancient Dragon, sizeof(int *) and sizeof(int) just gives 4 bytes. That makes size since all memory location are …

Member Avatar for Narue
0
348
Member Avatar for varsha0702

So the solution for that porblem is to stop using scanf function and perhaps WaltP has give you a good link on what are the function which need to avoided and it also explains about the scanf in more details so start thinking about an alter native way of reading …

Member Avatar for Beair.GQ
0
134
Member Avatar for Bamirasta

[QUOTE=Bamirasta;493678]But, Lets say what you have stored in your buffer is the contents of your file that you've open,. How do you get all the content of that file into your string without it stopping after the first null.???[/QUOTE] Sorry dint really get u when u said "without it stopping …

Member Avatar for Narue
0
91
Member Avatar for mjoshi

Here is a sample code which u could use or perhaps u can get an idea on how to use sscanf function to parse the string. [code] #include <stdio.h> int main() { char str[] = "# Name: C02427.mol TAUTOMER 1 2706"; char str1[20], str2[20], str3[20]; int D, D1; char FileName[35]; …

Member Avatar for Narue
0
139
Member Avatar for george22_jk

George, nobody is going to do u'r homework. Please read the form rules before asking question. It would be more better if u could show us what have u got so far. Do u know how the Depth First Search algorithm works. It very important u understand the algorithm before …

Member Avatar for Salem
0
177
Member Avatar for azalia

Thats one lot of mess, you should start indenting your code properly and perhaps what happened to your code tags. You will have to put your question properly in order to get more help. From what u have said i have come up with the sample code which will give …

Member Avatar for Narue
0
87
Member Avatar for samari

That piece of code just keeps in reating the same thing again and again for ever. I mean it just displays the same thing. U will have to update something as the game goes along. So you will have to get some input from a particular source. And have u …

Member Avatar for Colin Mac
0
183
Member Avatar for jobs

[QUOTE=WaltP;492559]Do you really want your operating system to do the logging? Or do you only need a file created with log entries in it?[/QUOTE] WaltP I am pretty curious to know now, how would you make OS to log things for. As far i know it should have done by …

Member Avatar for WaltP
0
1K
Member Avatar for n.aggel

i cant unzip it on my machine, just use the windows compress utility feature. Or perhaps just post the make file contents ssharish

Member Avatar for Barefootsanders
0
94
Member Avatar for ssharish2005

Hello, I have this problem from past few week now, which i haven't rectified. Hope I get some suggestion from here. I bought a new SATA2 Hdd 2 weeks before and there is no problem with that hard disk what so ever. The problem is with all my old hard …

Member Avatar for ssharish2005
0
100
Member Avatar for stilllearning

what actually are u trying to do with strfmon. You could so few things using sprintf family as well. As said before strfmon is not a standard function, no protability at all. ssharish

Member Avatar for ssharish2005
0
220
Member Avatar for Angel V

[QUOTE]im trying to sort my random numbers to odd numbers and even numbers,,[/QUOTE] What u wanted to sort on both odd and even in the same array. Stars all over head lol You can sort either on odd or even thats it. Perhaps u can have two array one sorted …

Member Avatar for ssharish2005
0
105
Member Avatar for jobs

[code] conf_fd=open("/etc/example/server.conf",O_RDONLY); read(conf_fd,conf,100); close(conf_fd); [/code] This reads the whole content of the file server.conf [code] /* Get server IP */ buffer=strtok(conf,";"); buffer1=strtok(NULL,";"); [/code] This breaks the string into two lines. [code] strtok(buffer,"="); server=strtok(NULL,"="); server_ip=inet_addr(server); [/code] This gets IP address from the second line. To be more precise, in the second …

Member Avatar for ssharish2005
0
102
Member Avatar for satya.vijai

Probably this would give u what u want. Try use that function and see what u get on each return value. LPCTSTR lpRootPathName, ssharish

Member Avatar for ssharish2005
0
110
Member Avatar for tractionmate
Member Avatar for Salem
0
321
Member Avatar for argonaut

I would really suggest to use the temp variable to swap two values. Cos the swapping variables without third variable such as using the arithmetic operators. This would really very help only when you wanted to swap unsigned integers. Apart from that it is not a recommended at all. If …

Member Avatar for Salem
0
77
Member Avatar for gplkrsna

What happenes, the function throwstring() return the pointer to the first elements of the string const - which is located in heap- to the main. And printf use the base address to print of the full string till it hits NULL. And as mentioned before. You should specify the int …

Member Avatar for Narue
0
150
Member Avatar for Ballar32

[quote] I'm getting a the error "passing arg1 of 'strcpy' makes pointer from integer without a cast.... [/quote] This is where you get the error right [code] strcpy(make,newnode->make); strcpy(model,newnode->model); [/code] strcpy will get two char pointer (char *) as an argument. But you are passing just a (char). Which in …

Member Avatar for Ballar32
0
267
Member Avatar for ssharish2005

Just wondering, if anyone has got a library or good link to parse a config file. If not is there any effcient way of hanlding config file, where the config is just normal text file. Its not XML file or anything. ssharish

Member Avatar for ssharish2005
0
96
Member Avatar for mitzoff

So which part fo the code u dont understand well? Where did u get the code from? ssharish

Member Avatar for iamthwee
0
159
Member Avatar for zite.1

Why do you want to use text editor, when you have a good IDE's. Try Dev-C++. ssharish2005

Member Avatar for Narue
0
112
Member Avatar for ssharish2005

[code] #include <stdio.h> void printarray(const int arr[][3]); int main() { int arr[][3] = {{1,2,3},{4,5,6}}; printarray(arr); getchar(); return 0; } void printarray(const int arr[][3]) { int i,j; for(i=0;i<2;i++) { for(j=0;j<3;j++) printf("%d\t", arr[i][j]); printf("\n"); } } [/code] This above code tends to give me a warning. [code] 9 D:\cprogramming\arr1.c [Warning] passing argument …

Member Avatar for Hamrick
0
106
Member Avatar for naserca

Before doing anything about it. You should be having a good understanding of how to use stack and learn more about POSTFIXand INFIX. And google about POSTFix and INFIX algorithm. You will some ton's links ssharish2005

Member Avatar for iamthwee
0
94
Member Avatar for tu_m.aimes

use sleep() function which is defined in time.h. It has only a resolution of 1 millisecond however. So if you say 5000 it would be 5sec i suppose. ssharish2005

Member Avatar for ashishtrivedi
0
214

The End.