Search:

Type: Posts; User: Athul

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    437

    Some basic doubts in pointer arithmetic

    Hello,

    I'm learning one embedded system course online, and while watching one of those video, I had some doubts about pointer arithmetic,

    while I was searching for answers I came across this...
  2. Understanding bresenham's line algorithm to move stepper motors

    Hello
    I have been trying to understand the code used in GcodeCNCDemo4AxisRAMPS, especially the algorithm used to draw a line. I have been reading several articles on Bresenham's line algorithm....
  3. Replies
    3
    Views
    617

    How come? here a is changing inside. So how could...

    How come? here a is changing inside. So how could compiler ignore it.



    Like when counter value reaches til a certain value?

    eg:

    if TCINT is a counter
  4. Replies
    3
    Views
    617

    Compiler optimization: volatile

    Hello,
    I have some doubts about compiler optimizing C code. This is more related to the field of embedded system.



    int a, b;

    void experiment() {
    a = 8;
    b = a * 7;
  5. Replies
    6
    Views
    3,392

    But the following code works ...

    But the following code works


    #include<stdio.h>

    int a = 10, b = 20, c = 50, i;


    int *arrop[3] = {&a, &b, &c};
  6. Replies
    6
    Views
    3,392

    SO how can I make above program work if it's...

    SO how can I make above program work if it's global. I tied putting const before array


    const int *arrop[3] = {p, &b, &c};

    Where can I find more details about it?
  7. Replies
    6
    Views
    3,392

    initializer element is not constant

    Hello,

    When an array pointers created inside the main, program works. But when I intialize array of pointers outside main, compiler gives error as

    Initializer element is not constant

    This...
  8. Replies
    6
    Views
    561

    In coming videos, he's using this method. I tried...

    In coming videos, he's using this method. I tried that code. But first variable is some junk value. I tried to understand his code by makeing a spreadsheet and trying to poin to various address,...
  9. Replies
    6
    Views
    561

    Tutorial - Google Drive...

    Tutorial - Google Drive

    This is the link to the video.

    Like I said further videos in this series make use of this tutorial
  10. Replies
    6
    Views
    561

    Creating a Queue using Double Linklist

    Hello.

    I'm learning about creating a queue using double link list using a video tutorial. I wrote this code as seen in the video. I don't have the source file shown in the video. I checked the...
  11. Replies
    5
    Views
    452

    So when I assign memory using malloc(). they are...

    So when I assign memory using malloc(). they are placed in read and write memory, right??
  12. Replies
    4
    Views
    587

    So to sum up When do as follows int *p =...

    So to sum up

    When do as follows


    int *p = 5;

    here value 5 is treated as an address
  13. Replies
    5
    Views
    452

    Here I'm assigning s to "Hello" char *s =...

    Here I'm assigning s to "Hello"


    char *s = "Hello";
    s[0] = '0';

    But this crashes program too
  14. Replies
    5
    Views
    452

    Initializing malloc()

    Why doing something like this okay



    char *s;
    s = (char *)malloc(100);
    s[0] = 0;


    but this crashes my program
  15. This is &(ptr + i)->age in fact same as this...

    This is &(ptr + i)->age in fact same as this &((ptr + i)->age)


    That makes sense

    Thanks
  16. Replies
    4
    Views
    587

    Thanks for the reply Does this mean, ...

    Thanks for the reply



    Does this mean,


    Int *p = 7

    here 7 is treated as address, not as value??
  17. Replies
    4
    Views
    587

    Difference between Int *p and int *p = &a

    Hello,

    Some way the pointers are used confuses me.

    When use as below


    int a = 5;
    int *p = &a;
  18. Array of structure: Structure members are enum varaibles

    #include <stdio.h>


    typedef enum {
    GREEN = 0,
    BLUE
    }COLOR;


    typedef struct{
  19. Replies
    2
    Views
    322

    So just like creating a structure variable we can...

    So just like creating a structure variable we can create a function that return a structure.

    Can you show a simple example to me??
  20. Replies
    2
    Views
    322

    function as structure variable

    Hello,

    I'm following this video Tic Tac Toe using c - YouTube to develop a Tictactoe game. In which the developer is using a structure and it's declared like this


    struct myDataType {
    ...
  21. Thanks for clarifying the difference I...

    Thanks for clarifying the difference

    I understand how this works


    struct person x;
    scanf("%s%d%f", x.name, &x.age, &x.weight);
  22. That was my question, need of & in ptr, even...

    That was my question, need of & in ptr, even though ptr is already the address

    In the first answer i got for this post

    So, back to your question. It looks like &(ptr+i)->name is actually wrong....
  23. changing this for(i =0; i < num;++i) { ...

    changing this


    for(i =0; i < num;++i)
    {
    printf("Enter name, age and weight of the person respectively:\n");
    scanf("%s%d%f",&(ptr+i)->name,&(ptr+i)->age,&(ptr+i)->weight);
    }
  24. Assigning value to structure members using -> operator

    #include<stdio.h>
    #include<stdlib.h>
    struct person {
    int age;
    float weight;
    char name[30];
    };

    int main()
    {
  25. Replies
    4
    Views
    1,618

    Thanks for the reply. Reason for I used %d...

    Thanks for the reply.

    Reason for I used %d instead of %p;

    I'm learning some advanced topics of c from a Udemy course "Advanced C programming : pointers". In which instructor uses %d. The...
Results 1 to 25 of 27
Page 1 of 2 1 2