User Profile

Collapse

Profile Sidebar

Collapse
pukur123
pukur123
Last Activity: Dec 1 '06, 03:14 PM
Joined: Sep 5 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • pukur123
    replied to GNU pow( ) works only sometimes
    in C
    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.
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to Size of the pointer to a function
    in C
    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....
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to Size of the pointer to a function
    in C
    The size of any pointer C is same as the size of an unsigned integer.
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to .wav file
    in C
    I am not getting anything from the above. Could you paste the code so that we can debug your code.
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to Code for Concatenation and substr
    in C
    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...
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to comparing numbers
    in C
    (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);
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to comparing numbers
    in C
    Use the ternary operator (?:)
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to Initializing structure member( char array)
    in C
    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...
    See more | Go to post

    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.
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to reading from a text file
    in Perl
    Paste the code here for debug.
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to how to use fgets
    in C
    It is not possible to get the fields in a line using fgets(). Because no field is of fixed length.
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to sorting dates
    in C
    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>
    ...
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to reading a csv file
    in C
    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.
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to I don't even know where to start
    in C
    Try this one....

    #include<iostre am>
    using namespace std;
    int main()
    {
    int k=0;
    while(k<97)
    {
    cout<<"*\n"<<en dl;
    k++;
    }
    }
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to reading a csv file
    in C
    Try this one........

    Spoonfeeding code removed - please read Posting Gudieliens

    Now see the files file1, file2 and file3.
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to sorting dates
    in C
    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.
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to reading a csv file
    in C
    Use the system() API to execute the above commands and then see the files file1, file2, file3. and then proceed.
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to sorting dates
    in C
    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...
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to sorting dates
    in C
    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.
    See more | Go to post

    Leave a comment:


  • pukur123
    replied to searching in c
    in C
    Give the description of the problem in details. I couldn't make anything from the your description. So be clear about the problem.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...