Thanks laserlight.
I followed the thread u suggested and it works, though gcc gives me warning after compilation.
Here's how my program look like
int main()
{
int mat[3][3];
Type: Posts; User: edesign
Thanks laserlight.
I followed the thread u suggested and it works, though gcc gives me warning after compilation.
Here's how my program look like
int main()
{
int mat[3][3];
Hi,
I want to pass a two dimensional array by reference to a function and then manipulate it's content in the called function.
I'm not sure about how to do it.
If you can help...
...
If I use the approach suggested by iMalc, it will work well for part 1 but when the experiement is repeated it will generate the same set of 500 numbers each time. Just in a different order. But...
I want it to be uniformly distributed precisely. If I generate a histogram, I want it to be flat, same count for all the numbers. I need to generate the numbers in [0,1]. If rand generates same...
Hi,
I need to generate 500 random numbers having uniform distribution. Does rand function ensure uniform distribution?
Thanks,
edesign
if a variable is declared as extern, for example
extern int x;
but it is not declared any where in any file then what will happen? Will x be allocated memory?
ok...if anyone using mtrace can suggest what may be the problem, it will be great help...
yes, I am running linux but to be precise I want to use this memory analyzer tool for an embedded application which uses MontaVista Linux Pro 2.1.
Googling it, I got to know that MVPro has a...
I need to have some memory analyzer tool which can detect memory leaks in a program (especially a multithreaded program)... is there any such tool available?
Hi,
In many codes and projects, I find variable names, structure definition, headerfile names starting with _ (underscore sign). Is that supposed to mean anything? Are they treated in some...
ya, now buffer2 is pointing to the location buffer1 used to. So I'll be able to free both the buffers (allocated memory) and that will no longer cause a memory leak.
and i don't have any code, i...
I also thought that it must be causing a leak, but was not so sure....
Thanks... :)
Edesign
what will happen if I have a piece of code like this
buffer = malloc(some_amount);
........
........
buffer = malloc(some_amount);
I don't have a free statement in between, when a second...
I am no one to think that you people can't write it ... I have learned everything on C board and I would encourage other people to do so .. the only reason I posted that piece of code is that after...
The loop may look something like this...
for(i=0; i<strlen(s1); i++)
{
for(j='a'; j< 'z'; j++)
{
if(s1[i] == j)
Thanks ... that was quite informative ... I enjoyed reading that
ya, this can help only if we are comparing with constants , so it is better to practice not making a mistake rather than practicing to write wierd looking expressions... :)
well, it happens to me... also a < 3 is ok , there s no benifit of writing 3>a, but in case of a == 3 it is the asignment , we are talking about ...
ya, it may look awkward but believe me when you have a long code and by chance you make such a mistake it will take you hours to identify that ... where as in 3 == a.. compiler will make your life...
cool........ I didn't realize, that performs a swap.. , and I am surprised why I haven't come across XOR-swap till now...
What is the purpose of this program?
It definitely does not perform a swap...whatever it does.. remove tmp, you'll still get the same result ...
In swap1 you are passing the arguements by reference and hence the swap occurs, where in swap2 you are passing the arguements by value : that means i1 and i2 are created locally in scope of swap2 ,...
hey,
I am still a newbie to this stuff, but I'm working on similar kind of stuff for a few days and as far as I've captured the things msgq is the best way to do that...(it may not be ... it is...
I read it in a blog and found myself smiling at the end, finding such a new genre of humor...
main(Episode_1)
All variables appearing in this work are fictitious. Any resemblance to real...
Well, without knowing about arrays it would be difficult...but looking at code's title that shouldn't be the case..what say...::D