Hello,
Another less obvious but often overlooked difference is,
strcpy() - The strings may not overlap, and the destination string dest must be large enough to receive the copy.
memcpy()- If copying takes place between objects that overlap, the behaviour is undefined.
(P.S. - This problem ate up my whole day to figure it out)
User Profile
Collapse
-
-
Hello,
U can also use exec*() functions.
http://linux.about.com/library/cmd/blcmdl3_execl.h tm
Regards,Leave a comment:
-
Hello,
What type of library do you want to create - static or shared? The following link is a good reference:
http://users.actcom.co .il/~choo/lupg/tutorials/libraries/unix-c-libraries.html
http://www.adp-gmbh.ch/cpp/gcc/create_lib.html
Regards,Leave a comment:
-
Hello,
I prefer SUN's cc or GNU's gcc or g++. For IDE, I generally code on Unix platform so use any editor(vi or ed).
Regards,Leave a comment:
-
For best execution speed, should I cache in Main memory or keep querying the Database
Hello,
In my application, I need to read data of two sizes - about 10 bytes and 5-50KB. I need optimum performance of my application - speed is my main concern. Would it be wise to read 10 bytes from database and 5-50KB data from main memory(this data is read from database and cached in memory)?
Please suggest. Thanx in advance. -
Hello,
TSDN members can help you much better if you post your xact problem, what did you attempt n where r u stuck?
If you are programming in UNIX, the header files are sys/socket.h contains socket functions and system calls. netinet/in.h contains protocol-related functions. Hope this gives you atleast a starting point.
Regards,...Leave a comment:
-
Hello,
A simple technique is to create a flag member in the node to indicate whether node has been visited or not. If the node is visited, the flag is set. If the node is revisited, the flag will be set indicating loop. However, if you want to find the loop, the algorithm will be too expensive.
Regards,Leave a comment:
-
Well it doesn't really matter who posts first. We all work for C/C++, right pal !!!...Leave a comment:
-
Hello,
Every image file has a header and data section. The header section contains the information about the entire image. The data section is the actual image. You can do some googling and find out the header format for images and read the header and data sections of the image file and display it on the output device.
Regards,Leave a comment:
-
Hello,
One possible way is to override displaySin() in the derived class:
Code:class Person { public: void displaySin(); }; class Student: public Person { public: void displaySin() { Person::displaySin(); } };
Leave a comment:
-
Hello,
Welcome to C.
1) for - Used when the number of times the loop will iterate is known in advance. e.g. for(i=0;i<10;i+ +) will iterate 10 times.
2) do - Used when the number of times the loop should iterate is not known. The loop iterates till the condition becomes false. e.g. while(mychar != '\n')scanf("%s" ,&mychar); will iterate till newline is entered.
3) do....while - This loop iterates...Leave a comment:
-
If the project type is not an Application (it could be DLL or anything else), the compiler will build but will not execute. Check the project type you have selected.Leave a comment:
-
Hello,
Only one #include should appear per line. However, this is a very trivial error.
The path for your include directory is not set. You can set it in the IDE or specify the path while compilation and linking at command line.
Regards,
HCV...Leave a comment:
-
Hello,
Following is the psuedo-code:
int coef1[10];
int coef2[10];
The index denotes coefficient of power n. e.g.3x2+2x1+1 will stored in array as:
coef1[2]=3;coef1[1]=2;coef1[0]=1;
Similarly for second polynomial.
Then, corresponding element in each array is added to get the addition of two polynomials.
Regards,Leave a comment:
-
calloc() allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the allocated memory. The memory is set to zero.
malloc() allocates size bytes and returns a pointer to the allocated memory. The memory is not cleared.
realloc() changes the size of the memory block pointed to by ptr to size bytes. The contents will be unchanged to the minimum of the old and new sizes; newly allocated...Leave a comment:
-
-
-
Hello,
Assuming that ur display is 'c' wide. Read the input till 'c' characters are read. Count the number of words 'w'. If the cth character is in the middle of the word, pushback the characters till delimiter(space ) is encountered. After each word, print w divide by c number of spaces.Leave a comment:
-
Hello,
printf("%.nd",a rg);
where n is the total digits in the number. e.g. printf("%.5d",1 00) will print 00100.
Regards,Leave a comment:
No activity results to display
Show More
Leave a comment: