▲ 38 r/cprogramming+1 crossposts

How can I improve my thought process in C interviews instead of relying on memorized solutions?

I was asked an endianness question in a recent Embedded C interview.

For example:

uint32_t n = 0x12345678;

I had previously learned the typical byte-swap approach and also i can do it for 16 bit

n = ((n & 0x000000FF) << 24) |
    ((n & 0x0000FF00) << 8)  |
    ((n & 0x00FF0000) >> 8)  |
    ((n & 0xFF000000) >> 24);

However, the interviewer asked me to convert the endian representation and store the result into a byte array using a pointer to the destination.

During the interview, my mind immediately went to the bit-manipulation code I had memorized, and I failed to do the simple program. How can I improve my thought process?

reddit.com
u/sudheerpaaniyur — 13 days ago
▲ 2 r/Udupi+1 crossposts

Guys, please list good restaurants, veg/nonveg/snackspots in Udupi. Please pin this post to the subreddit so we can access it easily.

reddit.com
u/sudheerpaaniyur — 15 days ago

How much time does it take to learn C++ if I’m already good at C?

I’m very comfortable with C, data structures, and pointers, and I work in the embedded domain.

Recently, I’ve been seeing C++ and Linux as common requirements in embedded job postings.

I’m currently learning Linux, but I’m not sure whether I should also focus on C++.

For someone with a strong C background, how many hours/months would it realistically take to become jobready in C++?

ps: Thank you for your suggestions, links.

reddit.com
u/sudheerpaaniyur — 1 month ago

What is the right way to write and debug a program?

I am preparing for DSA, and I find it difficult to debug arrays inside a function. When I enter the function in the debugger, I can only see the starting address and the value of the first array element. I am not able to see the other array values. What is the right way to debug this, and how should I write the program to make debugging easier?

This is sort01 code fro example:

debugging image : [debug.png](https://postimg.cc/JGfZ8jrd)

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

void sort01(int *array, int n)
{
    int tmp=0;
    int left=0;
    int right=n-1;
    while(left <= right)
    {
        if(array[left] !=0)
        {
tmp = array[left];
array[left]= array[right];
array[right]=tmp;
right--;
        }
        else
        {
            left++;
        }
    }
}
int main()
{
int array[]={1,0,1,1,1,0,0,1,0};
int n=sizeof(array)/sizeof(array[0]);
sort01(array, n);
for( int i=0 ;i<n ; i++)
printf( "%d",array[i]);
return 0;
}
u/sudheerpaaniyur — 2 months ago

This social media influencer crying and making money

Yesterday i have seen some channel views 3 lakh for 6 hours, content is crying and one guy his bmw got accident and in comments section people giving suggestions like they're his family.

Influencer and crying and people fall for this.

I was felt bad for our older generation watching daily soap and astrology , now younger falling for this social media influencer.

reddit.com
u/sudheerpaaniyur — 2 months ago
▲ 2 r/Udupi

Ajarkadu ground running track allowed for public ?

Please let me know, this ajjarakadu ground running trakc allowed for public?

reddit.com
u/sudheerpaaniyur — 2 months ago
▲ 19 r/Udupi

Free run marathon manipal

Completed 3k, it was raining and felt good.
Felt good, hope you guy attended.

u/sudheerpaaniyur — 2 months ago
▲ 4 r/EmuDev

is it possible to emulate spi in qemu?

i am just started learning qemu and able to simulate UART, now i want to try spi and i want to read write flash memory.

i have armt cortex mo+ qemu

ps:already any repo i svailable?

reddit.com
u/sudheerpaaniyur — 2 months ago

is it possible to emulate spi in qemu?

i am just started learning qemu and able to simulate UART, now i want to try spi and i want to read write flash memory.

i have armt cortex mo+ qemu

ps:already any repo i svailable?

reddit.com
u/sudheerpaaniyur — 3 months ago

Speed cameras in Udupi highway?

Do we really get a fine if we cross 80kmph in Udupi highways?

Just I'm curious daily i do see people crossing 80 speed

reddit.com
u/sudheerpaaniyur — 3 months ago

Which garmin watch i can buy?

Currently i have amazefit bip6 square dail watch and it broke two times once while swimming and second time while walking in staircase. Both case i hit my hand to rod.

Display cost is 2k.

I'm planning to buy garmin now, my requirements is i have road bike, i do gym, planning to run, frequently i do swim.

My plan is garmin forerunner 165 without music, is it good to go?

Note: i dont have any plans to iron man or trialthon or or any professional tournament.

reddit.com
u/sudheerpaaniyur — 3 months ago

could some one explaina diffrence between call, nested interrupt and contexswitch wr.t to ARM mcu

I am confused about contex switching topic

reddit.com
u/sudheerpaaniyur — 3 months ago

How did you learn your first back flip and front flip

How did you learn your first back flip and front flip into a swimming pool? Beginner looking for advice

I mean diving into the pool

reddit.com
u/sudheerpaaniyur — 4 months ago

Mangalore to Udupi there is many river , what is there original route?

I'm seeing pinakini near pangala and shambavi near mulki just example, undeta moola olpa?

Eranda gottu itunda panle

reddit.com
u/sudheerpaaniyur — 5 months ago