Search:

Type: Posts; User: shruthi

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    19
    Views
    2,881

    I tried pointing int (*p)[10] to a single...

    I tried pointing
    int (*p)[10] to a single dimensional array,the compiler was giving a warning,but when I made same kind of pointer to a 2d array,it excuted cleanly without throwing any warning.

    ...
  2. Replies
    19
    Views
    2,881

    #include int main() { int...

    #include<stdio.h>
    int main()
    {
    int arr[3],*q=arr,i;
    int (*p)[3]=arr;
    for(i=0;i<3;i++)
    scanf("%d",(q+i));

    for(i=0;i<3;i++)
    ...
  3. Replies
    19
    Views
    2,881

    scanf("%d",&a[i][j]); // this is fine I wanted...

    scanf("%d",&a[i][j]); // this is fine

    I wanted to know is there any other way to access the array using pointer,other than the way I have mentioned in my program?
  4. Replies
    19
    Views
    2,881

    isn't int (*p)[10][10]; different from int...

    isn't int (*p)[10][10];
    different from
    int (*p)[10];
    isn't the first one used to point to a 3D array and the second one used to point to the 2D array or are they both same?
  5. Replies
    19
    Views
    2,881

    pointer to a 2D array

    Hi Everyone!
    Is there another way to store and access the the 2D array using pointer to a 2D array.



    #include<stdio.h>
    int main()
    {
    int a[10][10],i,j,r,c;
    int (*p)[10]=a;
  6. Replies
    4
    Views
    21,451

    Actually the answer was varying from 0.000 to the...

    Actually the answer was varying from 0.000 to the right answer. So I thought there would be some problem with returning the double value.
  7. Replies
    4
    Views
    21,451

    To return a double value

    Hi everyone! When I take the help of pointers,by keeping the return type of the function as void,the program works fine,but when I try to pass the values to the function and use return type as...
  8. Replies
    7
    Views
    1,496

    This is great! Thanks :)

    This is great! Thanks :)
  9. Replies
    7
    Views
    1,496

    ok.Thanks :)

    ok.Thanks :)
  10. Replies
    7
    Views
    1,496

    I was just experimenting with using malloc and...

    I was just experimenting with using malloc and realloac on how to access and see if it was reading into the new loaction,so took an example of 5 and 8.That's when I realised the number of pointers...
  11. Replies
    7
    Views
    1,496

    using malloc & realloc

    Hi Everyone!
    Is there a way to reduce the number of pointers used in this program using malloc itself.


    #include<stdio.h>
    #include<stdlib.h>
    int main()
    {
    int *p,*q,i,*r,*w;
    p=(int...
  12. Replies
    16
    Views
    5,646

    Thanks :) It's working neatly when I added the...

    Thanks :) It's working neatly when I added the given code.
  13. Replies
    16
    Views
    5,646

    Ok,Ive given it a try. ...

    Ok,Ive given it a try.


    #include#include<stdio.h>
    #include<string.h>
    #include<stdlib.h>
    int main()
    {
    char *str1[3];
    char data[40];
  14. Replies
    16
    Views
    5,646

    I guess it's just easier to use a 2d char array....

    I guess it's just easier to use a 2d char array.
    I thought since you can store strings


    char *arr[3]={"mon","tuesday","wednesday"};

    I thought one could possibly take the user input and it...
  15. Replies
    16
    Views
    5,646

    I am tryin to use char array of pointer instead...

    I am tryin to use char array of pointer instead of a 2d char array,to reduce the fixed size usage of the 2d array.
  16. Replies
    16
    Views
    5,646

    #include int main() { char...

    #include<stdio.h>
    int main()
    {
    char *days[2]={"mon","tue"};
    printf("%s\n",days[0]);
    return 0;
    }

    Where in data mon & tue getting stored?
    Instead of initialising in the program I...
  17. Replies
    16
    Views
    5,646

    array of pointers passed as argument to fgets

    Hi Everyone!
    I am trying to use array of pointers to store strings and trying to take the input from the user for that I am using fgets,but it's throwing a segmentation fault.what is the right...
  18. Replies
    20
    Views
    3,632

    Thanks a lot everyone.

    Thanks a lot everyone.
  19. Replies
    20
    Views
    3,632

    When I checked the size of int and char*,it's...

    When I checked the size of int and char*,it's giving me 4 for both.But when I use char*,no warnings are displayed and displays the output as 8.
    How is it that when I use int it throws warning and...
  20. Replies
    20
    Views
    3,632

    Tried what you written,but's it's giving an...

    Tried what you written,but's it's giving an answer as 2 instead of the 8.
  21. Replies
    20
    Views
    3,632

    size of union without using sizeof operator

    Hi Everyone!
    I have written a code for it,it gives 2 warning messages but still gives the right answer.Can you share better ideas to implement for this concept.


    #include<stdio.h>
    union size
    {...
  22. Replies
    10
    Views
    45,426

    thanks a lot.

    thanks a lot.
  23. Replies
    10
    Views
    45,426

    with slight changes made to the program got the...

    with slight changes made to the program got the output,it wasn't the fault of '\n'.


    while(i<25-1)
    {
    scanf("%c",&c[i]);
    if(c[i]=='\n')
    break;

    i++;
  24. Replies
    10
    Views
    45,426

    It not terminating when I use '\n'

    It not terminating when I use '\n'
  25. Replies
    10
    Views
    45,426

    to take input till enter is pressed

    Hi Everyone!
    I am trying to store string input with spaces and the program should stop taking the input while the enter key is pressed.


    #include<stdio.h>
    int main()
    {
    char c[25];
    ...
Results 1 to 25 of 60
Page 1 of 3 1 2 3