Anonymous
Eugene
but char is a distinct type, different from both signed char and unsigned char
Eniafe
Please can someone explain how to print 1 - 100 in C but you can't print double numbey like 11 33 22 and only two combination if you have 12 you use 21 and like if you have 34 no 43
klimi
well, create a for loop for 1 - 100 and skip those which have the same digit?
Eugene
you definitely don’t need error 127, and since the array is up to 100, there is no point in int for two arrays in which you are counting.
Eyvaz
Eyvaz
Eugene
Нооооо
Eyvaz
Eugene
No
Eyvaz
No
char behaves like an integer
Eyvaz
i used it as index
Eugene
No
Eugene
print all char and you will understand that I am right.
Eyvaz
Eugene
Eugene
do you write for pc?
Eniafe
05 ==50?
So I would do it for everything like 05 == 50 && 01 == 10 && 02 == 20
Eniafe
Eyvaz
Eugene
Nooooo
Eugene
Eniafe
Eyvaz
Eniafe
What is that cout
Eyvaz
Eugene
I don't understand please
write two loops one inside the other. inside check if the indexes are uneven you can print the first and second index
Eniafe
Eugene
Yes
Eyvaz
Thank you guys
Aj
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
int main(){
int x=log10(100);
int n=pow(10,x);
cout<<n;
}
Aj
why vs code gives wrong output for this program
Aj
the ans is 100 but vs code gives 99 as output
Nils
Nils
replace the #define ll long long line with: using ll = long long;
Nils
wait they seem redundant anyways
Nils
So just remove them
Nils
then, check what log10 actually returns
Nils
Add a breakpoint to x
Aj
actually other compilers like codechef, gfg gives 100 but only vs code gives 99
Aj
could you please run in your vs code editor
Nils
Nils
log10 is implementation defined
Nils
It's not backed by any C standard from what I know
Nils
On Linux it's in the POSIX standard which Windows doesn't follow
Nils
Since all these online compilers run on Linux and you are on Windows, you get different results
Nils
Aka it's a bad compiler.
Aj
that's why i want to know, Is there any error in my vs code or it's universal
Nils
Aj
Vs code editor
Nils
Again, which compiler are you using?
Aj
i installed long time ago so i forgot
Aj
Felix
Hello guys I'm trying to write my own printf() in c using varags but I'm not getting the correct solution for this.cab anyone help me out
Pavel
줄리아 우지야노바
Lyroy
Hello, I need some help with the boost process library.
Basically, I want to execute a program and print the output in real time without having to wait for the process to finish. I've tried with the asynchronous API but I can't make it print while the process is running, I always have to wait for the termination of the process before printing its output.
Does anyone know how to do this?
Thadeu
How to understand it?
int *x = malloc(10 * sizof(int));
int *x = malloc(100 * sizof(int));
printf("%d %d", sizeof(x),sizeof(y));
prints:
8 8
Aquatica
Thadeu
but even with x[8] i cant get the size...
anywhere says that to get the length of an array I need to using:
sizeof(x)/sizeof(*x)
Pavel
Thadeu
hmmm... then if I need some dinamically I would need to malloc then keep a counter on the size, realloc before return (in case the array is smaller) and inform the caller with the array pointer and an array with size.
Thanks.
Pavel
wiz
"WSLENV": "ELECTRON_RUN_AS_NODE/w:"
wiz
hello every body, i'm trying to debug c/c++ with ubuntu wsl in windows 10 but i'm getting the bellow, can some please help "WSLENV": "ELECTRON_RUN_AS_NODE/w:"
\Device\NUL
Nils
pavel
Alireza
Hi👋
I have a problem in Visual studio 2022 , I want to add a pdf file or for example a txt file to the resource file for a cpp project
how can I do this?
Anonymous
how do solve
intellisense indentifier string is undefined in class
added in gui
Lyroy