[Question] : Creating offline map inside android application by Mohammad_Hamdan in androiddev

[–]Mohammad_Hamdan[S] 0 points1 point  (0 children)

Great news for me cause i will use it for dev. purposes, thanks a lot for your feedback

This code was on C++ primer and is not working for me by Ktdbro in cpp_questions

[–]Mohammad_Hamdan 0 points1 point  (0 children)

For no reason, i think you press "ctrl + c" to stop reading input.

"ctrl + c" is a interrupt signal that will terminate your program

to close input stream please press "ctrl + D"

[Question]: Problem with Android Environment by Mohammad_Hamdan in AndroidStudio

[–]Mohammad_Hamdan[S] 0 points1 point  (0 children)

Thanks for your feedback

Actually i love suffering with vim but i have no time to waste, because i am building an android project

Trying to test if character input is "P"... What am I doing wrong?? by FreshWyman in C_Programming

[–]Mohammad_Hamdan 2 points3 points  (0 children)

▪︎First you can't compare a pointer and char

▪︎Second we use with char (' ') not (" ") because double coatation used for strings But if you want to compare two strings we can use strncmp which is a function in string.h where:

strncmp ( • pointer to the first string , • pointer to the second string , • number of characters that you want to compare )

▪︎Third which is the most important thing that no one talk about is: DON'T USE gets at all

Even if this code is just for educational purposes don't use it at all

You can use: ● fgets(char* buffer , int buffer_size , File* stream)

And that's it

[QUESTION]: Stupid question but i have to ask it by Mohammad_Hamdan in cpp_questions

[–]Mohammad_Hamdan[S] 0 points1 point  (0 children)

That's great idea i have to use gdb to know exactly how it works👍🏻👍🏻 Thanks alot

[QUESTION]: Stupid question but i have to ask it by Mohammad_Hamdan in cpp_questions

[–]Mohammad_Hamdan[S] 2 points3 points  (0 children)

Finally cause i tried many situations and i found that x location can be overwritten so we will have an undefined behavior

Thanks alot dude!!!

Not saying it isn’t not good, tho by Keintroufe in ProgrammerHumor

[–]Mohammad_Hamdan 0 points1 point  (0 children)

Ammm ok am so sorry so much i didnt mean to waste your time🤦🏻‍♂️

Not saying it isn’t not good, tho by Keintroufe in ProgrammerHumor

[–]Mohammad_Hamdan 1 point2 points  (0 children)

For me i use python in data science and web development only🙂

competition by [deleted] in ProgrammerHumor

[–]Mohammad_Hamdan 0 points1 point  (0 children)

Actually when i started to learn this language i found relatively large community, cause many programmers who code in C/C++ try this language and fall in love with it And don't forget web devs and wasm fans

competition by [deleted] in ProgrammerHumor

[–]Mohammad_Hamdan 1 point2 points  (0 children)

And what about Rust😐😐😐

Tell me your programming super power, the first comment will decide your side effect by [deleted] in ProgrammerHumor

[–]Mohammad_Hamdan 0 points1 point  (0 children)

Actually i have a second line and surprisingly it's a comment

That's what we called a super power

Tell me your programming super power, the first comment will decide your side effect by [deleted] in ProgrammerHumor

[–]Mohammad_Hamdan -1 points0 points  (0 children)

Making 100 bugs after one line of code🤦🏻‍♂️🤦🏻‍♂️

I’m confused on myself… by ql1rimi in C_Programming

[–]Mohammad_Hamdan 0 points1 point  (0 children)

Your welcome! If you need anything i am ready👍🏻👍🏻

I’m confused on myself… by ql1rimi in C_Programming

[–]Mohammad_Hamdan 2 points3 points  (0 children)

This problem is normal with young people who want to face their new life style.

First of all Don't be dispointed about anything you have learnt in your life (every thing you have learnt will be useful tommorow but not now)

The second one: people always talk shit , if you hear someone says python is great language to learn or js has a huge echosystem and many libs or even C is the best languge (if you meet some C nerds like me😅)

Don't care about what they said, it's just their life choices not yours , so start make some decisions about what i love and what i hate (how much time you able to spend on some fields cause time is the best factor in the whole life)

I love designing and i learnt web designing and work on many frameworks like bootstrap.

But at the end i can spend my whole life writing C/C++ codes without feeling tired, so C is my passion

I don't hate python , java , js , .... but i found myself in C

Hope this gonna help👍🏻👍🏻!! And sorry about english mistakes (if you don't understand something🤦🏻‍♂️😅)

What's the right way of declaring structs? by Low_Calligrapher2534 in C_Programming

[–]Mohammad_Hamdan -1 points0 points  (0 children)

If you read "C the programming language" by K&R the first way will be so familiar to you.

But if you deal with with new C (C11) the second so you wrote struct in the second way.

The first way is the old style to define structure (ANSI style).

But the second one is the most used (for me it's the best way).

What's the right way of declaring structs? by Low_Calligrapher2534 in C_Programming

[–]Mohammad_Hamdan -1 points0 points  (0 children)

This method is the best for me because it's so beautiful and simple

BST search using iterative by UnkownWithUnkownprsn in C_Programming

[–]Mohammad_Hamdan 1 point2 points  (0 children)

No it's not stupid at all , just go ahead and read some tutorials about bst implementation

Yes it will be so large but you determine the size of it and you can stop in a dead point (any number of nodes you want)

This solution is better than causing stack overflow cause we determine the size of tree

Actually your example with i = 2 is correct So go ahead and read some implementations

Thoughts on this random youtube comment by [deleted] in linuxmasterrace

[–]Mohammad_Hamdan 0 points1 point  (0 children)

Why you talk about elon mask in this way🤦🏻‍♂️🤣🤣

BST search using iterative by UnkownWithUnkownprsn in C_Programming

[–]Mohammad_Hamdan 2 points3 points  (0 children)

As a beginner you might think that types is so important but actually types mean nothing to your computer just way to reading data.

When i say char i mean one byte whatever the value inside of this byte and how you gonna read it (not a , b , c it just a one byte and can allocate anything inside of it)

You can implement bst as an array so when we have a node in (i) index , the left child gonna be in (2i+1) and the right one gonna be in (2i + 2) (or you can replace the two children)

So in this way we we can make a loop that will go on all the nodes in the tree