V01D
I have a low level question (perhaps @lightness_races_in_orbit or @SysMario could help) I know that I have to disable interrupts when moving into 32 bit mode using the cli instruction. But I am looking through some IDT/ISR code of this kernel (https://www.github.com/nexos-dev/NexOS/tree/development/NexKe%2FHal%2Fx64) and I cannot see him enabling interrupts! Is this done automatically or what am I missing here?
.
Anyone had this book then please forward me😊
Anonymous
HELLO.....CAN ANYONE TELL ME THAT WHICH WHICH PROGRAMME SHOULD I DO AS A BEGINNER "C"....i have already done (HELLO WORLD,ADDITION,SUBTACTION,MULTIPLICATION, AND AREA OF CIRCLE"...I HAVE ALREADY DONE ABOVE MENTIONED PROGRAMMES...NOW WHAT SHOULD I GO FOR?
Pavel
HELLO.....CAN ANYONE TELL ME THAT WHICH WHICH PROGRAMME SHOULD I DO AS A BEGINNER "C"....i have already done (HELLO WORLD,ADDITION,SUBTACTION,MULTIPLICATION, AND AREA OF CIRCLE"...I HAVE ALREADY DONE ABOVE MENTIONED PROGRAMMES...NOW WHAT SHOULD I GO FOR?
1. Turn off your caps 2. After variables, input-output and arithmetics, you need to write something with conditionals, then loops, then arrays, ... I googled a list of excersises for you https://www.w3resource.com/c-programming-exercises/
Anonymous
THANK YOU SO MUCH @pavel
Matin Rzaev
int main() { char* str = _strdup("5267"); int result = 0; for (int i = 0; *(str+i) !='\0'; i++) { result = result * 10 + *(str+i); } cout << result << endl; cin.get(); return 0; }
Matin Rzaev
Matin Rzaev
Hi guys.Could you help me please? I want to convert string to int without using any specials functions.But the output is not correct.Because compiler doesn't add value of str[i],it adds value in ascii table.
Matin Rzaev
How i can fix that
...
thats because while accessing a char, you get a char, the char doesnt magically convert to an int
Pavel
Hi guys.Could you help me please? I want to convert string to int without using any specials functions.But the output is not correct.Because compiler doesn't add value of str[i],it adds value in ascii table.
It is how it works. What you can do is substract 48 from the ascii code (code of zero). But that's not a portable solution, you can use it to show off to your friends but don't use that in real code
...
try doing result = result * 10 + ((*(str + i )) - '0')
Matin Rzaev
It works correctly.Thanks so much guys 👍👍
...
please, dont use this in any sort of system that needs to be reliable..
Pavel
What is "code of zero"?
Every symbol has a char representation (can be 1 char in some encodings, can be 2+ in others). Numbers inside strings are no exception
Pavel
So I just provided ascii code of zero, the solution of @ff_0x1d3 with '0' is better though
Truth
Does that even compile?
Are you good at math
S s
Anyone want Html coding for website
Ammar
Are you good at math
I am trying to be. What can I do for you?
Truth
I am trying to be. What can I do for you?
I have some math problem can you solve
Anonymous
Pavel
Anyone want Html coding for website
"Html coding"? How is it related to C/C++?
V01D
Anonymous
HTML ... Wha.... Dear lord
Pooja
Thank you😁
Pooja
Anyone please let me how I can learn HTML5 and css3 to develop a web page
Pooja
What?
MᏫᎻᎯᎷᎷᎬᎠ
Any non related topic will be reported
Pooja
S s
What?
I can help you
Pooja
I can help you
Thank you😊
carnivorous plant
they have finally found each other
carnivorous plant
what a great relationship
Evgeny
Guys, can someone help? I have 2 variables char * var1 = "var2"; int var2 = 10; How can I print the contents of var2 (10) through var1?
Ammar
Guys, can someone help? I have 2 variables char * var1 = "var2"; int var2 = 10; How can I print the contents of var2 (10) through var1?
You can't, variables in C are not annotated after compile time is over. You have to make your own identifier and call each variable based on a such identifier. For example: int main() { /* define var1, var2, var3, var4, and so on here... */ int x = 1; switch (x) { case 1: /* do something with var1 */ break; case 2: /* do something with var2 */ break; /* and so on... */ } }
Ammar
But wait, I think it may be possible for global variables, since there is a corresponding symbol for each of them.
Ammar
PTRACE should be able to read the variable's value based on its symbol. Like debugger does.
Ammar
I have not tried it and I do not really know the technical detail, but it is clearly possible, since gdb can do that.
Evgeny
I think this is relevant https://linuxgazette.net/85/misc/sandeep/Ptrace.c.txt
It all looks like a very advanced solution, probably it will be easier for me to get around this method with a variable inside a variable and come up with something else.
Anonymous
#Ask Sorry, sis, permission to ask, here is someone who uses the C language text editor Sublime, Thank you.
Anonymous
I do.
Can I have a private chat?
Evgeny
Can you please explain with an example?
Harsh
Guys, can someone help? I have 2 variables char * var1 = "var2"; int var2 = 10; How can I print the contents of var2 (10) through var1?
Maybe this can help? int var2 = 10; int * var1 = &var2; std::cout << *var1 << std::endl;
Evgeny
Maybe this can help? int var2 = 10; int * var1 = &var2; std::cout << *var1 << std::endl;
@Johnn_D0e This doesn't solve my problem, but thanks anyway 💪🏼 I already figured out how to work around this and got stuck with a new problem ... love C 🤎
Anonymous
Can I ask a question related to math?
Asdew
If it's also a C/C++ question.
Asdew
If not, #ot.
Wojak
You will also find it as one of the best book on Stackoverflow community poll for C++. 5th edition is updated and re-written in 2012 for STL and C++11. But this actually is a good book for beginers and intermediate programmers. That's my own research, use google wisely for better reviews
Wojak
Dima
cute dog
Wojak
😂😂
Roxifλsz 🇱🇹
Nigga dog Nigga dog
Wojak
Nigga dog Nigga dog
😂😂😂😂😂😂😂😂😂😂
Valentine
Nice cock awesome balls
𝒜𝒷𝒹𝓊𝓁𝑀𝒶𝑒𝒷𝑜𝓊𝒹
Talula
What is this nude dog doing on your bed?
Pooja
How can i print minimum no. Of word from sentence using array in C.