Anonymous
and the same doesn't hold for stringstream, does it?
Stringstream is an in memory string buffer that allows the pointers to be different.
labyrinth
can anyone recommend an implementation of b+ tree in c++? with insert delete interface ?
Anonymous
Hi guys. I couldn't debug with visual studio code
olli
Anyone knows please dm
What have you tried?
olli
If you have a launch configuration your should be able to
olli
How can I find it
https://code.visualstudio.com/docs/cpp/launch-json-reference
Anonymous
I am Rihan I am new here 🙂
Anonymous
shriman_deepak
Determine the smallest even number and the greatest odd number in an integer sequence. Can anyone please help me to solve this algorithm !
Anonymous
[09/09, 21.04] Nur Islam: Write a program that reads positive numbers and calculates the average of read numbers. Program calls readint() to read an integer. Program stops reading if zero or negative number is entered. Program must print average value with 4 decimal accuracy. #include <stdio.h> #include <string.h> #include <stdlib.h> int readint(void); int main(void) { int num; float sum_of_numbers = 0; int number_count = 0; float average; num = readint(); if (num > 0) { sum_of_numbers = sum_of_numbers + num; number_count++; if (number_count > 0) { average = (sum_of_numbers / number_count); printf("%.4f", average); } } }
Anonymous
What's the wrong with the code? Any suggestions?
Anonymous
#include<cstring> #include<iostream> using namespace std; string rev_str(string txt,int len){ if(len==0) return txt[len]; /* Here i want to get returned last character but it is giving error why??????? */ return txt[len]+rev_str(txt,len-1); }
Captain
Rather, what's your logic here??
VENUJAN
#include <stdio.h> int main(){ int i,size,alphabet,digits,spl_char,space; char data[] = "ABCAkjdcnj"; size = sizeof data; for (i= 0;i<size-1;i++){ if ((data[i] >=65 && data[i] <=90 )|| (data[i] >=97 && data[i] <=122) ) { alphabet++; } else if (data[i]>=48 && data[i]<=57) { digits++; } else if (data[i]>=33 && data[i]<=47){ spl_char++; } else if(data[i]==32){ space++; } } printf("%d,%d,%d,%d",alphabet,digits,spl_char,space); }
VENUJAN
for this code why i got output for spl_char like this ?
VENUJAN
11,0,10251024,0 —-> i got 10251024 for spl_char , why? and got alphabet 11 but really there are 10 only.....
VENUJAN
what is that value i got for spl_char ?
Anonymous
what is that value i got for spl_char ?
It is some random value which happened to be at the place in memory (stack) where spl_char is defined.
Anonymous
https://gist.github.com/mgood7123/5d78bc011fefa6a0c69a8efea6b112c5 how do i correctly scale my relative rectangles to my parent absolute rectangle ?
Anonymous
Hello folks, I want to be a c++ developer, can someone recommend the road map. Thanks
Mazen
https://youtu.be/A57mCMZqNII
Alishba
https://pastebin.pl/view/899324d2
Alishba
Can somebody explain why p1 is not displaying
olli
Can somebody explain why p1 is not displaying
because you reassign p inside your isPalindrome. p should already be a string there is no need to change, reassign or allocate memory for it. Also you should really be using std::string since you're using C++, you are leaking memory all over the place.
Alishba
Ok thank uu
mayway
Anyone know any good intership channel..or good intership
Anonymous
https://pastebin.pl/view/899324d2
Because your program exhibits Undefined Behavior: int size; char *ptr=new char[size]; cout<<"Enter the size of the string"<<endl; cin>>size; Here you are allocating memory for ptr using an undefined variable size. You take the input value for size following this.
Alishba
Thankuu
Max
Who can help me How i can transform double in float ? If it is possible
Anonymous
(float)x ?
バレンタインがいない柴(食用不可)
Anonymous
Who can help me How i can transform double in float ? If it is possible
Modern Cpp: double x { 30.204 }; float y { static_cast<float>(x) };
Max
Thanks 😊
Anonymous
hello! why does iostream define abs and std::abs function? why i have acces to them? i thought i need include cmath math.h or anything..
Anonymous
so.. can i check what it includes?
olli
so.. can i check what it includes?
yes, you can look at the header, however you should rely on it as it might change after an update
Anonymous
thx
kabiru
Hello
kabiru
How can I write a program that print S.R.C.O.E
Hanz
How can I write a program that print S.R.C.O.E
#include <stdio.h> int main () { print("S.R.C.O.E\n"); return 0; }
Hanz
Yoi
kabiru
Int a;
kabiru
Int a; for (a=1; a<=10:a++) if (a%2=0) print f (a) with even numbers who came please?
Hanz
Your if statement is an assignment, not comparing numbers. Use == instead of just =
Hanz
?
kabiru
When
kabiru
How it print only even numbers
Suka
Int a; for (a=1; a<=10:a++) if (a%2=0) print f (a) with even numbers who came please?
Int a; for(a=1; a<=10:a++) if(a%2==0) printf(a) __________________________________^ = for assignment == for comparison. use == in if
Anonymous
template <std::ranges::input_range Irng> requires(std::unsigned_integral<typename Irng::value_type>) [[nodiscard]] constexpr unsigned convert(Irng &&s) { ... } i want to achieve something like this. but the requires clause doesn't actually work because there is no Irng::value_type. can someone suggest an alternative? requires(std::unsigned_integral<typename Irng::value_type>)
Anonymous
template <typename Irng> concept unsigned_range = std::ranges::input_range<Irng> && requires(Irng &t) { { *std::ranges::begin(t) } -> std::unsigned_integral; }; did this, someone please tell me if there is something better.
Anonymous
concepts:108:33: note: because 'const unsigned int &' does not satisfy 'integral' concepts:102:24: note: because 'is_integral_v<const unsigned int &>' evaluated to false urgh why the fck
Anonymous
i didn't want to use std::convertible_to because signed integral's would also be convertible to
Anonymous
This is more succint
Anonymous
So your convert function will be: template <unsigned_range Irng> constexpr unsigned convert(Irng &&s) { .... }
VENUJAN
#include <stdio.h> int main(){ char i; // char 'A'; for (i='A';i<='Z0';i++){ printf("%c\n",i); } }
VENUJAN
when i execute this code (put 0 near Z accidently) i got continuous beep sound ! why???
VENUJAN
is there any symbol for that
VENUJAN
i mean reason...........