Anupam2.7
Why there is str.at(n) function in c++ when we can simply using indexing i.e. str[n] ???
Anupam2.7
Thanks.
Dm
I have weird question.
How to write multithreading txt file parser which can work faster then 1 thread version?
I tried to do it in few ways but I see that processing speed sucks.
Dm
I use 1 thread to read and push to queue and in another thread I get front of the queue and parse but it still slower
Something like 40%-50% lose.
Void
#include <stdio.h>
#include <string.h>
int main()
{
char a[20];
int len,i,upper,lower,num,sym;
upper=lower=num=sym=0;
scanf("%s",&a);
len=strlen(a);
for(i=0;i<=len;i++)
{
if(a[i]>='A'&&a[i]<='Z')
{ upper=1; }
else if(a[i]>='a'&&a[i]<='z')
{ lower=1; }
else if(a[i]>='0'&&a[i]<='9')
{ num=1; }
else sym=1;
}
{
int sum=upper+lower+num+sym;
if(strlen(a)<6||sum==1)
{ printf("Not safe");
}
if(sum==2)
{ printf("Medium Safe"); }
else printf("Safe");
}
return 0;
}
Void
Guys why is sym=1 when I input 1234567
Kaptain
switch ("operator")
{
ERROR switch quantity not an integer
klimi
Kaptain
Ольга
Hello i need help with formula forFinding The difference areas of two rectangles when they intersect. Here is my version of the formula subtraction area=area1shape-area2shape+crosssectional area? It is correct?
klimi
meaning
You haven't put the correct thing into the switch
Anonymous
John
between char[] ,std::array<> and std:: vector<char> which one is better to use as packet buffer when handling socket in c++
Divyanshi
Anybody has any idea how to find square root of a number.
I want to know the logic to code the program
X
I have some doubts
X
I am unable to include windows.h
X
in vscode and vs studio
X
any idea to fix this I thought about windows sdk ?
Divyanshi
Divyanshi
Ok
Thanks!
Divyanshi
I don't think it's working....
Ludovic 'Archivist'
(only works with IEEE754 as it is basically a trick to get an estimate of log(x) and then you use Newton's method to refine it)
Ольга
Divyanshi
Anónimo
Hello, I have a question. How can I make the program round a number of 2 decimals places from 5? For example, if the final number is 33.105, I want the program to show 33.11.
Dm
Hello everyone
I would like to create function with template iterator (like this std::list<T>::iterator) but got was not declarated error
(10 line)
Could someone suggest solution ?
https://godbolt.org/z/7eEchn7sK
Anonymous
Dm
Anonymous
why?
if i delete templates everything works ok
That is how templates work. The problem is that with templates, when you call printLists with 4 arguments, it will see only the printLists with2 arguments and say that the arguments don't match.
This is one of the errors that you got in GodBolt link that you sent
The other errors are related to the missing typename keyword before the parameters in your overloaded function.
typename std::list<T>::iterator l1_it and so on.
This will inform the compiler that iterator is a typename and not some static value
Dm
Dm
Omar
I hope someone can help
line 54: you have to assign an initial value to a stack variable that is Null
lines: 58,59: you have to print the call of the sum function
like : cout<<sum(stack);
Lines: 13,26,37,45: you have to pass stack parameter by reference not by value because it is changed in your functions
like : (node* &stack)
in the definition of functions
Ольга
John
Shahadat Shanto
WAP that will take (m x n) positive integer inputs into a matrix of dimension m x n. Now replace all the duplicate integers by -1 in that matrix
Shahadat Shanto
how to do this? any idea?
Daulet
Shahadat Shanto
skip that part.
Daulet
Ok
Shahadat Shanto
for(int i=0; i<m; i++)
{
for(int j=0; j<n; j++)
{
if(arr[i] != arr[j])
{
arr[i][j] = -1;
}
cout<<arr[i][j]<<" ";
}
Shahadat Shanto
I've tried this
Daulet
Shahadat Shanto
tell me
Daulet
Pass all values to std::set
Daulet
And search values from this set
Shahadat Shanto
ok
Anonymous
Anupam2.7
https://pastebin.com/SCtXTXcA
What is the use of function initcounter(void) in line 9 and what does { counter = 0;} means in line 9 after declaring the function initcounter(void)
?
ngdream
hi
Official hooligan of Pius XII
Manish
Do anyone know how to do thread safe in C++ without using mutex and synchronisation??
Fr
What is the best masterclasses to learn web development online?
Richard Luo 🐱
Is there any clangd alternative which uses gcc?
Richard Luo 🐱
Clangd is great but I encountered a lot of issues when using c++20.
Daulet
Richard Luo 🐱
Richard Luo 🐱
Richard Luo 🐱
https://www.godbolt.org/z/Kze41jejo
Richard Luo 🐱
The code compiles with gcc, but clang or clangd cannot do it
Sajid
Is their any group discussion about opencv and deep learning in telegram?
Anonymous
hi what can make 2 printf with the \n in there end show in the same line and how to fix it
Anonymous
```c
Anonymous
printf("grind size ([C]ourse,[F]ine): \r\n");
scanf("%c", &grind_size);
if(*grind_size == 'C' 'c'){
Course = 1;
Fine = 0;
}
else if(*grind_size == 'F' 'f'){
Course = 0;
Fine = 1;
}
printf("Bag weight (g): ","\r\n");
scanf("%f", &Bag_weight);
G = Bag_weight;
gram= 453.5924;
pound = 0.0022;
Lbs = G * pound;
Anonymous
when it run it show in the same line
Anonymous
grind size ([C]ourse,[F]ine):Bag weight (g):
Rain Bow
#include <stdio.h>
int main()
{
int length;
int width;
int Rectangle (length*width);
printf("Enter the lenght : ");
scanf("%d",&length);
printf("Enter the width :");
scanf("%d",&width);
printf("Total area : %d",&Rectangle);
scanf("%d,%d",length,width);
return 0;
}
Rain Bow
Rain Bow
Am using C/C++ compiler on mobile