Its library problem......
compile like this
gcc -lm program.c
Here lm option specifies that the C file contains some functions belonging to the libm library.
User Profile
Collapse
-
Hi tyreld,
can you say in which distribution of linux the pointer takes the size of an unsigned long.
I am using RHEL3 and in this distribution I am not getting any difference between an unsigned int and unsigned long....Leave a comment:
-
The size of any pointer C is same as the size of an unsigned integer.Leave a comment:
-
I am not getting anything from the above. Could you paste the code so that we can debug your code.Leave a comment:
-
Why don't you give a try??
concatenation.. ..........
your should be same as the prototype of strcat()
char *xstrcat(char *str1, char *str2)
move the pointer forward unless it points to a null character, i.e., access all the elements of the first string by the pointer str1. Then acceess each element of second string to the first. At last add a null character.
Provide...Leave a comment:
-
(condition)? e1:e2;
If the condition is true then e1 will be evaluated otherwise e2 will be evaluated.
Let us suppose that a,b,c are the three numbers and the statement for finding the maximum of these three is.....
max=(a>b)?((a>c )?a:c):((b>c)?b :c);Leave a comment:
-
-
As soon as you declare the variable of the structure, it takes memory. So it will take the memory for the array s1.name and the base address of this array get stored in s1.name.
Now the statement
s1.name = "jimmy";
is trying to change the base address of the array which is not possible.
Instead you use the strcpy(s1.name, "jimmy").
Let's analyse the following...Leave a comment:
-
Keep on accessing each element of the string and check whether it falls in the range 48 to 57. Because ASCII code of '0' character is 48 and '9' character is 57. If it doesn't fall in the above mentioned range then given input is not a number.
If the given string is a number then use atoi() API to convert it to an integer and atol() to convert it to long integer.Leave a comment:
-
-
It is not possible to get the fields in a line using fgets(). Because no field is of fixed length.Leave a comment:
-
Actually all the filenames are hard coded. So make a file date.txt with the following data in the directory where the program is....
24 may 2010
12 aug 2007
12 aug 2006
15 aug 2006
07 aug 2006
12 aug 2005
24 may 2003
Before running the code below take the backup of the above file.
#include<stdio. h>
#include<string .h>
...Leave a comment:
-
See cut command will cut the required columns of the file and we are redirecting the output to a file. And system API will help you run any system command from the C code.
See the man page for cut.Leave a comment:
-
Try this one....
#include<iostre am>
using namespace std;
int main()
{
int k=0;
while(k<97)
{
cout<<"*\n"<<en dl;
k++;
}
}Leave a comment:
-
Try this one........
Spoonfeeding code removed - please read Posting Gudieliens
Now see the files file1, file2 and file3.Leave a comment:
-
In the first post you siad that you have the data in the dd/mm/yyyy format. Exacly in what format the dates are there in the file. And in the next 6 hrs you will get the code.Leave a comment:
-
Use the system() API to execute the above commands and then see the files file1, file2, file3. and then proceed.Leave a comment:
-
Go through the following APIs in C.....
fopen
fclose
fgetc
fputc
fscanf
fprintf
By using these functions you can retrieve the characters, words and even lines from a file.
You have to know the how to parse a string and your string contains the character / as the delimeter. So you will get three different strings out of this.
Convert the strings to integers...Leave a comment:
-
Read the dates one by one and parse the line to get each field of the line in separate strings and then convert them to integers and keep on storing in an a two dimensional array and then apply the sort mechanism.Leave a comment:
-
Give the description of the problem in details. I couldn't make anything from the your description. So be clear about the problem.Leave a comment:
No activity results to display
Show More
Leave a comment: