Hi All I got the solution
Use sys/stat.h
int __cdecl _fstat(int, struct _stat *);
User Profile
Collapse
Profile Sidebar
Collapse
zahidkhan
Last Activity: Nov 23 '06, 06:32 AM
Joined: Sep 10 '06
Location:
-
Any API to get file creation time
Hi All,
Any body has any idea abt this.
I have to write a function which will take existing file name as an input parmeter
and will return file creation time.
I need to implement this function using C for windows/solaris system
Thanks in advance..... -
Hi ,
You have declared the struct sales within the scope of main
and this structure is not visible to compare function
Declare the structure before main and include string.h it will work fine.Leave a comment:
-
use this compare function
int compare(const void *a,const void *b)
{
struct sales *psales1= (struct sales *)a;
struct sales *psales2= (struct sales *)b;
return strcmp(psales1->part_number,ps ales2->part_number) ;
}Leave a comment:
-
-
Read each charactes instead of reading set of characters
while(1)
{
int ch=0;
cout << "Enter number 1 (0-99999999):";
ch = getche();
if(ch == 13 || ch == 26)//ENTER KEY/CARRIAGE RETURN
{
break;
}
}Leave a comment:
-
modifying same variable in a single expression is generally undefined
It vary from compiler to compiler...Leave a comment:
-
-
-
Hi Check the code below, You will get some idea
void getpass(char passwd[])
{
int ch;
while(1)
{
printf("Enter your password : ");
u_int index=0;
while((ch=getch ())!=13)
{
if(index < 8)
{
passwd[index]=ch;
}
index++;
putch('*');
}
if(index <2 || index > 8)//enter key...Leave a comment:
-
TMemConIter is a type inside the scope of class example
so you can access it only using class name :: typedef name
like example<int>::T MemConIter...Leave a comment:
-
int main(int argc,char* argv[])
{
if(printf("Are you expecting " \
"something like this....")){}
return 0;
}...Leave a comment:
-
you can use this
#include<stdlib .h>
int main()
{
system("start cmd");
return 0;
}...Leave a comment:
-
Replace your print function with this
void print(node *p)
{
if(p!=NULL)
{
print(p->next);
printf("%d-->",p->number);
}
}...Leave a comment:
-
Use command line arguments instead of reading it from console
or take an input as string expression using cin.getline and later parse the string to operands and operator....Leave a comment:
-
Here internally algorithm find is comparing two pointers
Since pointer of your class can't call the == operator
you have to pass the object
And you should use const myClass& as a parameter of == operator
because algorithm find is receiving your object using const & and
and there is no operator defined which will take your operands as const reference
So the final solution...Leave a comment:
-
-
If you want to avoid for loop or while loop then you have to use recursion
void str_reverse(cha r str[],int startIndex,int endIndex)
{
if(startIndex >= endIndex) return;
str_reverse(str ,++startIndex,--endIndex);
str[startIndex-1]^=str[endIndex]^=str[startIndex-1]^=str[endIndex];
}
int main(int argc,char* argv[])
{
char str[] = "MyString";
str_reverse(str ,0,strlen(str)) ;...Leave a comment:
-
Hi ,
include <float.h> this will solve your problem
and make it sure that you are allocating the memory
for each individual pointers
If not so then your application may crash or core dump....Leave a comment:
-
Hi ,
First make it sure that your Files are there in the current working directory
or you can specify the full path name in fopen,
Something like this
if ((in = fopen("C:\\BURU \\BURU1.TXT", "rt"))== NULL)
{
fprintf(stderr, "Cannot open input file.\n");
return 1;
}...Leave a comment:
No activity results to display
Show More
Leave a comment: