Forum: C Mar 23rd, 2009 |
| Replies: 5 Views: 446 Well, that because you used the scanf function to read the value. The quick solution for this is to place two getch or getchar()! Or you will have to call the following function just above the... |
Forum: C Mar 22nd, 2009 |
| Replies: 3 Solved: Help please,,,,,,,,,,,,,, ,,, Views: 278 Re: Help please,,,,,,,,,,,,,,,,, >how do i save the c programs i compiled on borland c++ on the dekstop???????????????????????
Well, when you compile the C code you would the binary or the .exe file out of it. Unless you have any... |
Forum: C Sep 28th, 2008 |
| Replies: 4 Views: 7,632 Use sprintf function to convert int to string. Thats the more portable way of doing it. Since itoa is not portable!
char *cvtInt( char *str, int num)
{
sprintf( str, "%d", num );
}
... |
Forum: C Sep 28th, 2008 |
| Replies: 12 Views: 1,154 YES it is :) Perhaps the OP should check the value of n, before sending the value to the fact function.
print "Value for n ?"
read n
if( n >= 1 )
print fact( n )
else
Error |
Forum: C Sep 28th, 2008 |
| Replies: 12 Views: 1,154 Well, you got to be pretty careful on what your placing in the recursive function. The function is built to find the factorial for a given number. Tell me what are you trying to achieve.
Why do... |
Forum: C Sep 27th, 2008 |
| Replies: 12 Views: 1,154 Well there are few thing which you need to consider. First of all the function name is not write. In you code you have declared a function prototype clearly, but why dosn;t that reflect in your... |
Forum: C Sep 27th, 2008 |
| Replies: 12 Views: 1,154 int return1 (int n);
Why is that semicolon there??? Delete that! Syntax error
ssharish |
Forum: C Sep 26th, 2008 |
| Replies: 12 Views: 1,154 Perhaps you should make an effort to search on the form. There might be like tons of results on this issues. But here is the pesudo code.
<return type of int> function name FACT ( taking int as... |
Forum: C Sep 7th, 2008 |
| Replies: 5 Views: 534 You dont have to have such a huge list if and else to do this. You to reduce that to just few lines of code. Looks the my version of convert function.
int convert( char *str, int *number )
{
... |
Forum: C Sep 7th, 2008 |
| Replies: 2 Views: 503 scanf("%d", &miles);
You need to read double here. But you are reading integer. Or at least change the type of miles here to integer. You might actually expect some meaningful result.
And... |
Forum: C Jul 25th, 2008 |
| Replies: 8 Views: 1,062 Well, i could see some other problem as well now with that code. Can you please post the error message please
ssharish |
Forum: C Jul 25th, 2008 |
| Replies: 8 Views: 1,062 #define GCD();
Take of that semicolon from that statment. Macros donst need a semicolon. If your marco definiation are like too big then you might use a '\' to speak it up and concatenate.
But... |
Forum: C Jul 24th, 2008 |
| Replies: 15 Views: 1,411 pLike, you should really consider looking at on how to indentent you code first. Well the error message you get there is basiclly specifying that GetInteger cannot be assigned to the interger. It... |
Forum: C++ Jul 24th, 2008 |
| Replies: 7 Views: 3,295 He did ask, on how to create process and stuff. The link should give him an idea. Perhaps Salem's solution seems the best!
ssharish |
Forum: IT Professionals' Lounge Jul 24th, 2008 |
| Replies: 6 Views: 1,864 >dry runs
True, should have notices that key work.
ssharish |
Forum: IT Professionals' Lounge Jul 24th, 2008 |
| Replies: 6 Views: 1,864 Well, the pesudo code should be converted to a code and then try with some test input.
Well, YES, you cant just compile a pesudo code. So on what language are you suppose to implement the pesudo... |
Forum: C++ Jul 24th, 2008 |
| Replies: 11 Views: 1,201 Ohh man, you need to properly indentent your code. It so difficult to go through with that code.
Identent your code, you might except more help.
And what is '#' char in each line? Dosnt look... |
Forum: C++ Jul 24th, 2008 |
| Replies: 7 Views: 3,295 You perhaps have a look into a concept called Inter Process Communication (IPC) Have a look at the following tutorial.
You create a new process by call a function called fork() and you start a... |
Forum: C++ Jul 24th, 2008 |
| Replies: 7 Views: 3,295 Well, that gonna be difficult using the system function, since the function doesn’t return anything expect the status i.e 0 or 1.
What you could do is pipe the output to a file and access that... |
Forum: C Jul 23rd, 2008 |
| Replies: 8 Views: 1,062 Perhaps, you should have posted this question on a C++ form :-/.
And few things which I saw in your code, which you might have to consider to correcting
#include <stdio.h>
to
#include... |
Forum: C Jul 23rd, 2008 |
| Replies: 5 Views: 676 I don’t have much to say, b’cos most of the clues on why this happened has been already pointed out. But the main cause for this problem is when you run the code once and then try running it once... |
Forum: C++ Jun 28th, 2008 |
| Replies: 10 Views: 2,134 Well, it does make any difference in assiging the a string to a char pointer. What I really wonder is how is that killing your processor. Is there any loops which goes to an infinite loop? Or there... |
Forum: C Jun 24th, 2008 |
| Replies: 2 Views: 446 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... |
Forum: C Dec 26th, 2007 |
| Replies: 7 Views: 1,870 YES, it does say to prototype there
http://linux.die.net/man/3/get_current_dir_name
ssharish |
Forum: C Dec 21st, 2007 |
| Replies: 3 Views: 4,441 Jobs you are in a right track. Thats right When do this
void foo(FILE *fp);
in main
foo (fp);
When you call foo the address of the file pointer will be copies and sent to the foo... |
Forum: C Dec 21st, 2007 |
| Replies: 15 Views: 1,740 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... |
Forum: C Dec 17th, 2007 |
| Replies: 4 Views: 737 i cant unzip it on my machine, just use the windows compress utility feature. Or perhaps just post the make file contents
ssharish |
Forum: C Aug 9th, 2007 |
| Replies: 4 Views: 2,022 Why do u want to place that in a 3 byte stream when that can fit in 2 byte stream.
ssharish2005 |
Forum: C Aug 9th, 2007 |
| Replies: 3 Views: 632 I am seeing this as a second post now. :)
ssharish2005 |