you have to print the list of all the files in a directory and all
its sub directories?
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send ema
it should be like c=a
than will give no error.
On Tue, Sep 13, 2011 at 9:45 AM, bharatkumar bagana <
bagana.bharatku...@gmail.com> wrote:
> *a = 20; gives seg fault .. because 'a' has not been allocated memory
> space...
>
>
> On Mon, Sep 12, 2011 at 2:28 PM, Kunal Patil wrote:
>
>> Allocate mem
*a = 20; gives seg fault .. because 'a' has not been allocated memory
space...
On Mon, Sep 12, 2011 at 2:28 PM, Kunal Patil wrote:
> Allocate memory for pointer variables.
>
>
> On Mon, Sep 12, 2011 at 11:03 AM, sukran dhawan wrote:
>
>> run time error
>> first int * a is not assigned some addre
Allocate memory for pointer variables.
On Mon, Sep 12, 2011 at 11:03 AM, sukran dhawan wrote:
> run time error
> first int * a is not assigned some address... so it will be pointing to
> some garbage value
> second two pointers of different types without a typecast will result in
> unpredictable
run time error
first int * a is not assigned some address... so it will be pointing to some
garbage value
second two pointers of different types without a typecast will result in
unpredictable results
On Mon, Sep 12, 2011 at 10:25 AM, teja bala wrote:
> #include
> main()
> {
> int *a;
> char *c;
@Ishan
it is giving segmentation fault ... wat it means? and can u plz correct d
code...
On Mon, Sep 12, 2011 at 10:30 AM, Ishan Aggarwal <
ishan.aggarwal.1...@gmail.com> wrote:
> *c = *a;
> It will result in an run-time error.
>
>
> On Mon, Sep 12, 2011 at 10:25 AM, teja bala wrote:
>
>> #inc
*c = *a;
It will result in an run-time error.
On Mon, Sep 12, 2011 at 10:25 AM, teja bala wrote:
> #include
> main()
> {
> int *a;
> char *c;
> *a = 20;
> *c = *a;
> printf("%d %c",*a,*c);
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks"
#include
main()
{
int *a;
char *c;
*a = 20;
*c = *a;
printf("%d %c",*a,*c);
}
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algo
Find the output of the following code - plzzz xplain the o/p
int find(int j)
{
if(j>1)
{
j=find(j/10)-(j%10);
printf("%d",j);
}
else
{
j=0;
}
return j;
}
int main()
{
int i=19222;
int k;
k=find(i);
}
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" g
DO NOT use ideone for unix specific system calls. Granted that it is an
online compiler but it is best to test unix specific system calls on unix
itself..
Ok, so here goes.
A few basics that need to be told before hand..
*fork() system call creates a child process, and returns its process id to
http://ideone.com/o4r4o
but it is calling red and green just two times each..
On Mon, Aug 29, 2011 at 11:06 PM, rajeev bharshetty wrote:
> @Anup : I think you should also try to compile and check the answer...
> May be I am wrong But compiler won't
>
>
> On Mon, Aug 29, 2011 at 11:02 PM, Anu
>
>
> @Anup
>
Can u pls explain the program ?
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegrou
@Anup : I think you should also try to compile and check the answer...
May be I am wrong But compiler won't
On Mon, Aug 29, 2011 at 11:02 PM, Anup Ghatage wrote:
> @Rajeev:
>
> I had written down the recursion tree on paper but since you said that
> there were 10 reds and greens, I compiled
@Rajeev:
I had written down the recursion tree on paper but since you said that there
were 10 reds and greens, I compiled the code and checked it myself.
I'm afraid you are wrong my friend.
The correct answer is indeed 6 RED and 10 GREEN calls.
--
Anup Ghatage
--
You received this message bec
@rajeev:can u pls explain?
On Mon, Aug 29, 2011 at 10:09 PM, rajeev bharshetty wrote:
> Each of the red and green are being called 10 times..
>
>
> On Mon, Aug 29, 2011 at 9:41 PM, Anup Ghatage wrote:
>
>> If I'm not mistaken,
>>
>> red() will be called 6 times and green() will be called 10 time
Each of the red and green are being called 10 times..
On Mon, Aug 29, 2011 at 9:41 PM, Anup Ghatage wrote:
> If I'm not mistaken,
>
> red() will be called 6 times and green() will be called 10 times.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm
If I'm not mistaken,
red() will be called 6 times and green() will be called 10 times.
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send emai
void red()
{
}
void green()
{
}
main()
{
fork();
int color=fork();
if(color==0)
fork();
red();
if(color==0)
fork();
green();
getch();
}
How many times red and green are called ?
please explain it?
--
You received thi
@pankaj: nice answer...well done..;)
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For m
in fn1
ptr is pointer to integer i and you are changing content of i by using *ptr
from 10 to 100
in fn
ptr is pointer to integer i and you are changing pointer ptr by pointing to
val(now ptr no more point to integer i).so here only pointer is changing not
value.
am i clear to you?
On Fri, Apr 1
see this c code.
#include
void fn (int *ptr)
{
const int val=100;
ptr=&val;
}
void fn1(int *ptr)
{
*ptr = 100;
}
main()
{
int i=10;
printf("%d ", i);
fn(&i);
printf("%d ", i);
fn1(&i);
printf("%d ", i);
}
What is the difference betw
No
const char * p is a pointer to a constant string, and is not itselves a
constant pointer!
On Sun, Oct 10, 2010 at 11:41 AM, Harshal wrote:
> @Soumya
> Typedef merely adds a new name for some existing type, here for char* type
> in your code.
> So instead you should write *typedef const char*
@Soumya
Typedef merely adds a new name for some existing type, here for char* type
in your code.
So instead you should write *typedef const char* char*p rather than *typedef
char* char*p. bcoz you want new name for the whoole thinge (const char*),
not just char*.
--
You received this message beca
charp is not a textual replacement of char* since it is typedef.
const charp p and
charp const p
are both equivalent to p being a constant pointer to character.
On Sun, Oct 10, 2010 at 10:19 AM, Soumya Prasad Ukil
wrote:
> @kewat,
> If it is const char*, then compilation won't give
@kewat,
If it is const char*, then compilation won't give error. But
it is something like char *const. But how?
On 10 October 2010 08:31, umesh kewat wrote:
> Dear prasad
> after pre-compiling the expression is like
>
> const char* p = &a, so now u can understand y its const poin
const char * => pointer to a const integer rt?
Correct me if am wrong.
On Sun, Oct 10, 2010 at 8:31 AM, umesh kewat wrote:
> Dear prasad
> after pre-compiling the expression is like
>
> const char* p = &a, so now u can understand y its const pointer
>
>
> On Sun, Oct 10, 2010 at 1:07 AM, So
Dear prasad
after pre-compiling the expression is like
const char* p = &a, so now u can understand y its const pointer
On Sun, Oct 10, 2010 at 1:07 AM, Soumya Prasad Ukil
wrote:
>
> #include
> main()
> {
> char a ='c';
> typedef char* charp;
> const charp p=&a;
> p++;
>
#include
main()
{
char a ='c';
typedef char* charp;
const charp p=&a;
p++;
}
Why p is a constant pointer ?
--
regards,
soumya prasad ukil
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email
28 matches
Mail list logo