Search:

Type: Posts; User: vivekraj

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    7,903

    Integer max value:

    As tabstop mentioned,you include the limits.h header file in your program.You can simply the print the values by using the macros such as INT_MAX to get the maximum value and INT_MIX to get the...
  2. Replies
    10
    Views
    2,232

    Number of Arguments:

    You can find the number of command line arguments passed by the user using argc variable.
  3. Replies
    5
    Views
    2,359

    Copying file:

    You can copy the file from one directory to other using the following command.



    cp sourcedirectoryname/sourcefilename destinationdirectory
  4. Replies
    6
    Views
    1,672

    Otherwise,you can use Get-Content command to get...

    Otherwise,you can use Get-Content command to get the file content from online.
  5. In your case,if you want to get the input as...

    In your case,if you want to get the input as integer alone,you can use int number instead of double number.If you're going to store only one character for specifying units,you can use simple...
  6. Replies
    10
    Views
    1,355

    .h files are used to store the list of functions...

    .h files are used to store the list of functions which can be used as a library.You can't compile these files.But,you can include these files in your .c file to use the functions in that file.

    .c...
  7. Replies
    7
    Views
    2,829

    int *ptr = (int*)(&a+1); The above statement...

    int *ptr = (int*)(&a+1);


    The above statement will take the size of an array which is 16 bytes and when it is incremented by 1,16 bytes will be added to it.

    In the case of second statement,
    ...
  8. Replies
    7
    Views
    2,829

    Actually,you're changing the value of the address...

    Actually,you're changing the value of the address of an array a with the following statement in your program.



    int *ptr = (int*)(&a+1);


    The above statement makes the pointer of an array...
  9. Thread: matrix

    by vivekraj
    Replies
    2
    Views
    867

    I think this is a homework for you.You post the...

    I think this is a homework for you.You post the code what you have tried so far.We aren't here to write and give program to you.You explain your problems,we will help you.
  10. Replies
    10
    Views
    23,543

    Copying structures

    You can simply assign one object to another.You try the following code.



    #include <stdio.h>
    #include <stdlib.h>
    struct myStruct
    {
    int *x1;
    int x2;
  11. You use the fgets and fgetc function to read all...

    You use the fgets and fgetc function to read all the contents of file into buffer.You continue reading from file until reaching EOF in the file.For this,you can use feof function which will check...
  12. Replies
    6
    Views
    30,156

    Yeah,it works when fd is opened as O_WRONLY mode...

    Yeah,it works when fd is opened as O_WRONLY mode as well as if fd is opened for read and write mode which is O_RDWR flag in open function.
  13. Thread: Help please.

    by vivekraj
    Replies
    3
    Views
    940

    Instead of asking the program from others,you...

    Instead of asking the program from others,you post your code.We will look on it and help you.We don't know what algorithm and how did you implement the code.For testing the values given by user,you...
  14. Replies
    6
    Views
    7,611

    Yeah,it will seek the input from user by reading...

    Yeah,it will seek the input from user by reading from standard input and stores the given value to the pointer specified as the second argument to scanf function which is given after the format...
  15. Replies
    6
    Views
    30,156

    It is working for me.The function write returns 1...

    It is working for me.The function write returns 1 as its value which means 1 character written into the file.I tried a program.
    When I opened the created file in vim editor,it showed me the...
  16. Replies
    4
    Views
    1,514

    You just change the arguments to copy_struct...

    You just change the arguments to copy_struct function as follows.



    void copy_struct(instruction *src,instruction *dest)
    {
    *dest=*src;
    }

    You also do one more change in calling that...
  17. Replies
    2
    Views
    1,282

    Yeah ronrardin,you're correct.You need to pass...

    Yeah ronrardin,you're correct.You need to pass the arguments to copy_function as pointers.Then only the changes done will be get affected after you return from the function.Else,the structure values...
  18. Replies
    4
    Views
    1,186

    Ganesh program works good.But,I want to add one...

    Ganesh program works good.But,I want to add one exception handling in it.

    In his program,he opened the file in append mode.If the file not exits,then it will create and it will seek for string...
  19. Replies
    7
    Views
    2,167

    As ganesh mentioned,its a recursive process.When...

    As ganesh mentioned,its a recursive process.When you call the print function with root->right as an argument.Then in the print function,you will print the right node of the current node which is

    ...
  20. I have tested the following code in my machine...

    I have tested the following code in my machine and it worked perfectly.You check this code.It will also alert you when there are no records if you try to delete or modify or list.


    ...
  21. Replies
    7
    Views
    2,167

    I didn't understand what you have explained.Did...

    I didn't understand what you have explained.Did you follow the algorithm mentioned by ganesh?
    Tell me whether you stored all the values what you have mentioned in tree format or not.You can print...
  22. Replies
    7
    Views
    2,167

    You have to print the values in the tree by...

    You have to print the values in the tree by traversing your tree.I think you have inserted the values to a tree in the tree format.You simply follow the same way to print the values.While printing...
  23. Replies
    12
    Views
    7,355

    You try the following code. #include...

    You try the following code.



    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    struct person{
    char firstname[30]; //array for storing the firstname
  24. Replies
    14
    Views
    1,299

    The following program is reading the keys passed...

    The following program is reading the keys passed to the program and print them.For example,I simply printed the arguments.If you have any argument,you use those strings in your cypher.


    ...
  25. You try the following code.It will do the...

    You try the following code.It will do the requirement.



    #include <stdio.h>

    void printContact ();
    typedef struct {
    int prefix,
    number,
Results 1 to 25 of 36
Page 1 of 2 1 2