klimi
cppreference
Tute
Anyone pls material on how to develop C software
Deitel&Deitel How to program books for introduction
Anuz--@
Please share me C++ DSA notes
Mikko
Dear all, I am starting to learn coding and recently I am working on leetcode, could anyone let me know what is wrong with those code? It always gives the wrong answer.
Mikko
int search(int* nums, int numsSize, int target){ int right, left, pivot; numsSize = strlen(nums); right = numsSize-1; left = 0; while(left <= right) { pivot = left + (right -left)/2; if(nums[pivot] == target) return pivot; if(target < nums[pivot]) right = pivot -1; else left = pivot +1; } return -1; }
Mikko
Many thanks for your help!
Ибраги́м
P1642R11: Freestanding Library: Easy [utilities], [ranges], and [iterators] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1642r11.html
Ludovic 'Archivist'
@QNeko what do you think ?
It definitely is progress in the right direction, even if it is not for right now. I actually have an implementation of some of the ranges (more on that when I release it) and other tools for freestanding environments, I will release a library with io, tasking, ranges, containers and algorithms when I feel it is ready enough. I am looking for testers and people that would want to participate in an online hackaton on that topic btw
Anonymous
Anonymous
Hi, I just had this question for a long time abt address buses in CPUs and how we can measure our CPUs address bus width, I had read an article about the amount of supported RAM in different CPUs, and it was said that 2 to the power of the number of CPU bus address wires width(2^Address Bus Width = Addressable amout of memory by CPU). here is the question; For example an 8088 CPU that has 20 bits address bus, which is equivalent to 1,048,576 bytes although equal to 1 MB of RAM(it can address and support 1MB of RAM), even though its registers are 16 bits(So the calculations were not performed on the registers; it performed on address bus width), but a 32-bit CPU is not measured by the address bus width like 8088, it performed on 32 bit registers(vice versa) and the bits are measured is equal to 4GB, which we all know about(for those who dk, 32 bit CPUs cant address more that 4GB of Ram for example if you snap in an 8GB Ram it only supports 4GB of it!). And the 64 bit cpu is measured in the same way as 32 bit, does this mean that the 32 bit cpu has 32bit address bus width and the 64 bit cpu has 64? If this is the case, then why do 64-bit CPUs that address petabytes of RAM have a RAM support limit of less than 128GB depending on the CPU model in most cases; and if this is not the case, then why do we address the size of rigesters for amount of addressable RAM?
64-bit is the maximum capasity on a ... billion ... and never up to 128-bit that's so many long long long bit maybe trillion size i have an a article for your question 😎
Anonymous
64-bit is the maximum capasity on a ... billion ... and never up to 128-bit that's so many long long long bit maybe trillion size i have an a article for your question 😎
https://www.quora.com/Why-are-computers-limited-to-32-bit-and-64-bit-Why-not-128-or-256-or-512-bit-like-graphics-cards?share=1
Anonymous
Thanks alot
а
Fortnite or PUBG?
Map
Please I need mega link data structures in c course Any help
Anonymous
Please I need mega link data structures in c course Any help
what are mega link data structures? need more details.
Anonymous
No, I just don't know what it is.
Anonymous
Mega.nz is a file hosting site
I see. It is an oss service.
Ryota
Hello Everyone...
Ryota
Can anyone please walk me through the process of hand tracing...
/
Hi i need help
/
How can I decrypt a function name at runtime
/
Function name not the function
urs
Can anyone suggest me how to learn C ? Any app or some other YouTube videos ?? Note : I'm a beginner
Elaar
Can anyone suggest me how to learn C ? Any app or some other YouTube videos ?? Note : I'm a beginner
Hello! Try Sololearn, though they don't teach from a beginner's perspective but I prefer it that way. It'll be easier if you know the basics so as to get much insight.
Dima
don’t even try courses or something
Anonymous
exact, for intel/amd doesn't support architecture 128-bit except extended register and for 32-bit architecture it is usually used for system developers
Map
what are mega link data structures? need more details.
I mean I want data structures in c course or tutorial From mega.nz link
Дон
Hi there. Why I should write: class S { static constexpr size_t size = 100; }; instead of this? class S { constexpr size_t size = 100; };
Pavel
Hi there. Why I should write: class S { static constexpr size_t size = 100; }; instead of this? class S { constexpr size_t size = 100; };
static tells that the member is static to the class, not stored in each instance. constexpr doesn't change this aspect.
Дон
It shouldn't
I find it strange to give a compile error
Pavel
I find it strange to give a compile error
What kind of error do you get?
Дон
What kind of error do you get?
Invalid use of non - static data member with constexpr
Pavel
Invalid use of non - static data member with constexpr
Do you use it as size of c-array or template argument?
Pavel
Cuz if you are, it should be static, otherwise you can access it only as part of an object (an instance)
Дон
Do you use it as size of c-array or template argument?
No, I use it only like in example. Maybe it depends on compiler.
Map
#include<stdio.h> #include<conio.h> void main() { float dollar, inr, rupees; int ch; clrscr(); do { printf("\n\n* WelCome to Webeduclick Currency Converter *"); printf("\n\n 1.Rupees -> Dollar"); printf("\n\n 2.Dollar -> Ruppes"); printf("\n\n 3.Pound -> Ruppes"); printf("\n\n 4.Euro -> Ruppes"); printf("\n\n 5.Kuwaiti Dinar -> Ruppes"); printf("\n\n 6. Exit"); printf("\n\nEnter your choice = "); scanf("%d",&ch); switch(ch) { case 1:printf("\n\nEnter the currency in Rupees = "); scanf("%f",&rupees); dollar=rupees/75; printf("\n\nThe currency in dollar is = %.2f$",dollar); break; case 2:printf("\n\nEnter the currency in Dollar = "); scanf("%f",&rupees); inr=rupees*65; printf("\n\nThe currency in Ruppes is = %.2f",inr); break; case 3:printf("\n\nEnter the currency in Pound = "); scanf("%f",&rupees); inr=rupees*100; printf("\n\nThe currency in Ruppes is = %.2f",inr); break; case 4:printf("\n\nEnter the currency in Euro = "); scanf("%f",&rupees); inr=rupees*85; printf("\n\nThe currency in Ruppes is = %.2f",inr); break; case 5:printf("\n\nEnter the currency in Kuwaiti Dinar = "); scanf("%f",&rupees); inr=rupees*240; printf("\n\nThe currency in Ruppes is = %.2f",inr); break; case 6:exit(0); } } while(ch<4); getch(); }
Map
This currency converter code is correct
Map
Can someone please brief me now the calculation is done
Saro
#include<stdio.h> #include<conio.h> void main() { float dollar, inr, rupees; int ch; clrscr(); do { printf("\n\n* WelCome to Webeduclick Currency Converter *"); printf("\n\n 1.Rupees -> Dollar"); printf("\n\n 2.Dollar -> Ruppes"); printf("\n\n 3.Pound -> Ruppes"); printf("\n\n 4.Euro -> Ruppes"); printf("\n\n 5.Kuwaiti Dinar -> Ruppes"); printf("\n\n 6. Exit"); printf("\n\nEnter your choice = "); scanf("%d",&ch); switch(ch) { case 1:printf("\n\nEnter the currency in Rupees = "); scanf("%f",&rupees); dollar=rupees/75; printf("\n\nThe currency in dollar is = %.2f$",dollar); break; case 2:printf("\n\nEnter the currency in Dollar = "); scanf("%f",&rupees); inr=rupees*65; printf("\n\nThe currency in Ruppes is = %.2f",inr); break; case 3:printf("\n\nEnter the currency in Pound = "); scanf("%f",&rupees); inr=rupees*100; printf("\n\nThe currency in Ruppes is = %.2f",inr); break; case 4:printf("\n\nEnter the currency in Euro = "); scanf("%f",&rupees); inr=rupees*85; printf("\n\nThe currency in Ruppes is = %.2f",inr); break; case 5:printf("\n\nEnter the currency in Kuwaiti Dinar = "); scanf("%f",&rupees); inr=rupees*240; printf("\n\nThe currency in Ruppes is = %.2f",inr); break; case 6:exit(0); } } while(ch<4); getch(); }
You could at least format this code
Pavel
No, I use it only like in example. Maybe it depends on compiler.
Right, now I see, I didn't know that, but it seems that they can't be non-static (however I get different error) https://stackoverflow.com/questions/27408819/why-cant-non-static-data-members-be-constexpr
Дон
So you just declare it and not use?
Oh, my bad, I declare and use it in method, I didn't try to do something illegal.
Map
Ok
I want to get the concept now the calculation is done.
Anonymous
Hey guys , does anybody have a good documentation about C++ debugger in visual studio code ? Kindly share .
Дон
Can someone explain why my program doesn't work and return a strange value, please. I think it's segmentation fault, but I can't find it. Code: #include <iostream> class String { public: static constexpr size_t init_size = 100001; size_t current_size = init_size; char* string; String() { string = static_cast<char*>(malloc(init_size)); } String(const char* s) { size_t i = 0; while (s[i] != '\0') { if (i <= current_size) { string[i] = s[i]; i++; } else throw std::out_of_range("Out of range"); } } }; int main() { String sample; sample = String("hi"); //Program returned: 139 }
ngdream
hello every one i've created a start condition (for string) in flex and everything works fine but when I parse the same string twice a string the elements using the start condition vanish how can i solve it ?
Дон
Try to put i++ under if(i <= current_size)
Why? At first I should consider string[0]
Daulet
Why? At first I should consider string[0]
Ты знаешь русский?
Daulet
No
Ok. Error is in second constructor with argument const char*. You forget allocate memory
Дон
Ok. Error is in second constructor with argument const char*. You forget allocate memory
But I did it, no? Because at first program invoke default ctor
Daulet
But I did it, no? Because at first program invoke default ctor
In C++ by default can't be invoked two constructors. Only one constructor can be invoked
/
help
/
i need help what this thing means {((unsigned char)(((int)param2)))}(ptr5, *(ptr4 + 48), param2, param3, *ptr4);
/
it is from a decompiler
Daulet
But I did it, no? Because at first program invoke default ctor
If you pass nothing (), then invokes first constructor. If you pass string(const char*), then invokes second constructor
ngdream
here is my github repository https://github.com/ngdream/H5assembler
ngdream
https://controlc.com/77f9beed
/
why nobody help me
Дон
If you pass nothing (), then invokes first constructor. If you pass string(const char*), then invokes second constructor
Yes. The program invoked default ctor in this line: String sample; So that means I allocated memory for char* string Then in this line: sample = String("Test"); I accessed to that memory and try initialize
ngdream
help
where is your code