Search Results

Showing results 1 to 40 of 78
Search took 0.02 seconds.
Search: Posts Made By: tux4life ; Forum: C and child forums
Forum: C Sep 20th, 2009
Replies: 7
Views: 451
Posted By tux4life
In your previous thread you've already been suggested to use code tags, perhaps you missed it?
Anyway here (http://www.daniweb.com/forums/announcement118-3.html)'s the link which will directly bring...
Forum: C Aug 27th, 2009
Replies: 4
Views: 740
Posted By tux4life
In addition: http://www.gidnetwork.com/b-43.html
Forum: C Jul 30th, 2009
Replies: 17
Views: 636
Posted By tux4life
@RobBrown:
>was rather unhelpful, and honestly not very bright...

I'm very sorry that my eyes aren't good enough to see the error messages on your computer's monitor.
Do you maybe expect that...
Forum: C Jul 30th, 2009
Replies: 21
Views: 1,756
Posted By tux4life
Plenty of questions, plenty of weak programmers, or both ?
Forum: C Jul 30th, 2009
Replies: 21
Views: 1,756
Posted By tux4life
Only that proves to me that you didn't get what they describe in that link :)
It's not because you quickly want to test out some code that you may use bad coding styles.
Bad coding styles are...
Forum: C Jul 30th, 2009
Replies: 21
Views: 1,756
Posted By tux4life
Hey Dream2Code, read this:
http://www.gidnetwork.com/b-58.html
Forum: C Jul 30th, 2009
Replies: 21
Views: 1,756
Posted By tux4life
>I can't make any sense of the OP's question?
Well, I'm not sure what he's trying to do (as he didn't provide an illustrating example).
I think he wants to convert a 'readable' string to a string...
Forum: C Jul 30th, 2009
Replies: 21
Views: 1,756
Posted By tux4life
>string ss="this is an encrytpion program";
Could it be that you meant: char ss[] = "this is an encrytpion program"; here?
Otherwise please clarify.
Forum: C Jul 30th, 2009
Replies: 17
Views: 636
Posted By tux4life
Can you also post all the errors you're having?
Forum: C Jul 30th, 2009
Replies: 17
Views: 636
Posted By tux4life
>I am having a hard time writing a program to do the following.........
Please tell us where you're having problems with.
Forum: C Jul 28th, 2009
Replies: 12
Solved: SHA-1 in C
Views: 429
Posted By tux4life
> s = system("sha1sum -t a.txt");
system() doesn't return the output of an executed command.
It returns an integer value, which indicates whether it could execute the command successfully or not....
Forum: C Jul 26th, 2009
Replies: 7
Solved: silly
Views: 242
Posted By tux4life
Forum: C Jul 26th, 2009
Replies: 7
Solved: silly
Views: 242
Posted By tux4life
Edit:: Don't bother reading this.


>We cant write i=i++ as i =i;
I didn't say that, can you quote me the sentence?

I guess you didn't understand me, let's analyze it:
If you write i=i++;,...
Forum: C Jul 26th, 2009
Replies: 7
Solved: silly
Views: 242
Posted By tux4life
Edit:: Don't bother reading this.

Writing i=i++; is essentially the same as writing:

i=i;
i++;
and because it's the same variable here it's essentially the same as writing:
i++;
Forum: C Jul 26th, 2009
Replies: 9
Solved: Getchar
Views: 546
Posted By tux4life
getchar() will only get one character, which means that when you enter a character and press the ENTER button on your keyboard, the ENTER is not read (which means it stays in the input stream,...
Forum: C Jul 26th, 2009
Replies: 9
Solved: Getchar
Views: 546
Posted By tux4life
Well, if you can't get me, then you probably can't get someone else who's trying to help you, so it's probably the best that you don't waste your time here.

In order to get help, you first have to...
Forum: C Jul 26th, 2009
Replies: 9
Solved: Getchar
Views: 546
Posted By tux4life
Some important things you should pay attention to:

Please wrap your code between code tags:

// your code here


Don't use void main() it's evil, use int main() instead.
Use proper...
Forum: C Jul 17th, 2009
Replies: 18
Views: 688
Posted By tux4life
I know a way to get the return value in a command line window on Windows.

First compile this program, and run it manually from the command line:

#include <stdio.h>

int main(void)
{
int...
Forum: C Jul 17th, 2009
Replies: 18
Views: 688
Posted By tux4life
Some people urgently need to learn how to use the forum search feature, check this related thread:
http://www.daniweb.com/forums/thread146681.html
Forum: C Jul 17th, 2009
Replies: 18
Views: 688
Posted By tux4life
Too lazy to just split them up like this?

getchar();
return 0;

It's better to return a fixed value when your program has exited successfully because in your current program, the return value...
Forum: C Jul 17th, 2009
Replies: 12
Views: 634
Posted By tux4life
Dream2Code,

Sure you didn't mean:
a=strstr(b,"name");
instead of:
a=strste(b,"name");
?

I assume this was a typo because probably the r-key comes just after the e-key on your keyboard.
Forum: C Jul 17th, 2009
Replies: 30
Views: 1,629
Posted By tux4life
1) read only
2) writeable

3) wrong, you only create a pointer of type char, this can't hold a string.
BTW, if you had written it like this:

/* wrong */
char abc[5];
abc = "xyz";
Forum: C Jul 15th, 2009
Replies: 12
Views: 634
Posted By tux4life
Sorry I misunderstood you.

>can we do it using C?
Using standard C: no.
Using the OS's API: yes.

>i mean to say a function which i can call in between inside a program to check memory usage. ...
Forum: C Jul 15th, 2009
Replies: 12
Views: 634
Posted By tux4life
>How to check memory usage by a program by writeing a C program.
A profiler (http://en.wikipedia.org/wiki/Software_performance_analysis) is used for such purposes.

>When the program terminates...
Forum: C Jul 14th, 2009
Replies: 30
Views: 1,629
Posted By tux4life
No, let's revise: your pointer points to a string constant (remember it's a constant = read-only), up until here there's nothing wrong, but further in your program there's an instruction which tries...
Forum: C Jul 14th, 2009
Replies: 5
Views: 463
Posted By tux4life
Possible, but if your main function contains your whole program, then I would rather suggest you to use: return exit_code; instead of the exit() function :)
Forum: C Jul 14th, 2009
Replies: 5
Views: 463
Posted By tux4life
Why would you want to wrap this if around the while:

if (k > 1 && m < n)
{
while(k > 1 && m < n)
{

}
}
Forum: C Jul 13th, 2009
Replies: 30
Views: 1,629
Posted By tux4life
A little addition on:

Yes, an array name is a constant pointer to the first element of that array.
Forum: C Jul 9th, 2009
Replies: 11
Views: 594
Posted By tux4life
Depends on the way how you implement it, if you each time decrease with 3, then you only have to check whether it's higher or equal to 3.
Forum: C Jul 7th, 2009
Replies: 11
Views: 594
Posted By tux4life
Well, I would be glad if you had read my post:

:)
Forum: C Jul 7th, 2009
Replies: 11
Views: 594
Posted By tux4life
You don't understand what I'm saying, right?
Forum: C Jul 7th, 2009
Replies: 11
Views: 594
Posted By tux4life
Why starting with 30 if you can easily start with 3 and each time add 3 ?
Then the output will be in a more logical order, right?
Forum: C Jul 7th, 2009
Replies: 11
Views: 594
Posted By tux4life
Step 1: Get an integer from the user (store it in a variable)
Step 2: Check whether the integer is higher or lower than zero:


IF number < zero:
Print out the multiples (Step 3)


Step 3...
Forum: C Jul 2nd, 2009
Replies: 5
Views: 271
Posted By tux4life
return (void*) y;
What do you do here?
You create a pointer and put the value of y in it, this means that you let the pointer point to memory address 10 (not to the value 10 !!) in your example,...
Forum: C Jul 2nd, 2009
Replies: 5
Views: 271
Posted By tux4life
It's not recommended to just program it like that because you return a pointer to a local (automatic) variable, and when the function returns, the variable will be 'destroyed' (this means: it doesn't...
Forum: C Jun 30th, 2009
Replies: 21
Views: 1,196
Posted By tux4life
>Wait, what?? If you hover your mouse over the red box with text you see the code. That sure is weird!

That's because he has used TEX-tags to post his code, here's the code he was actually trying...
Forum: C Jun 30th, 2009
Replies: 21
Views: 1,196
Posted By tux4life
Eureka!
I've found one, Dave:
http://www.daniweb.com/code/snippet258.html

:)
Forum: C Jun 25th, 2009
Replies: 10
Solved: Data Type
Views: 618
Posted By tux4life
>There's plenty of big-number libraries on the net, or if you have the programming ability, you can write your own big-number class.
Huh? A class in C ??

:P
Forum: C Jun 24th, 2009
Replies: 10
Solved: Data Type
Views: 618
Posted By tux4life
The GNU MP Bignum (http://gmplib.org/) library is a very good one :)
Forum: C Jun 24th, 2009
Replies: 8
Views: 318
Posted By tux4life
A quick guide on passing variables by reference, using pointers

Consider this function:

void padd(int *p, int b) // create a pointer to an integer variable (parameter)
{
*p += b; // add...
Showing results 1 to 40 of 78

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC