Could be done this way, somewhat similar to scandir routine,
Declare an array to hold the filenames.
DIR *dir_p;
struct dirent *dir_entry_p;
dir_p = opendir(<dir name>);
Type: Posts; User: patil.vishwa
Could be done this way, somewhat similar to scandir routine,
Declare an array to hold the filenames.
DIR *dir_p;
struct dirent *dir_entry_p;
dir_p = opendir(<dir name>);
Look at this,
J =1;
if ((i=j++)==1)
printf("If i-%d,j-%d\n",i,j);
else
Yep, Both looks similar!
Thanks a lot...!
I've leant (learning) C++ and excited to exercise its concepts n features, but the problem is i'm not able to conceptualize my program totally in OOP way, since i've worked extensively structured...
Yes, global variables are initialized to zero (even static variabels).
You cant expect to print the aString as "boo" in main & will print only inside changeAString func.
If you want to do so then declare the variable temp in the global scope, as now it is local to...
Thanks for the clarification....!
{
char (*a)[100];
a = malloc (2 * 100);
a[1] = "Hi ";
a[2] = "Hello";
/*need to put more records to a, so go for resize...!*/
a = malloc (4 * 100);
I'd done this already, see it looks as i mentioned earlier...
int main()
{
int a,b=3;
a= ( ( b ++ ) * ( b ++ ) * ( b ++ ) );
printf("%d %d \n",a,b);
Your code looks like this after preprocessing.
int main()
{
int a,b=3;
a =(b++ * b++ * b++); /* CUBE(b++) gets replaced.
printf("%d %d",a,b);
Thanks a lot for the detailed explanation....!
i've seen it nw and understood that it wont fail as you mentioned rather could make the maintenance difficult.
Could you tell in detail for not to cast the malloc result.
I feel we should, since the malloc returns void pointer.
I've been doing this and it works well with C...!
Yes, as matp and others said malloc should not be used in global scope.
I've re-arranged your code to make it work...!
...
#define SIZE_MAX 100
typedef struct stack
{
char...