ברני
So I need anouther int to calculate with the digit exept the int num?
ברני
Const int min = 1?
Ammar
https://onlinegdb.com/S1EChX3vv
If the input is guaranteed to be a valid number. You could have used char[] to store the input from stdin with fgets, it will be easier to be processed digit by digit.
Ammar
https://gist.githubusercontent.com/ammarfaizi2/680e6895597f9676ec0f0fa610cdecd3/raw/06d5dba426ceb9d211702519e742e4d400670c91/min_digit.c
ברני
what's the p stands for?
ברני
Pose? /temp?
ברני
Why did you wrote the %10 out from the while loop?
Anonymous
ברני
Its working perfectly Ty! but I'm still in logic problems about the p before the while.. Why do I need this p only once? just to compare it later to digit?
ברני
I see. Ty very much!
Anonymous
Does any of you uses the windows.graphics.h library?
Anonymous
No, burn it with fire
-What library should I use? it's not a complex program but speed is important
Anonymous
2D obv
Anonymous
C, not C++
Mar!o
OpenGL
Anonymous
SFML
Thanks bro I'll use this one
Vlad
SFML
sfml is C++ only
Vlad
I don't think binding is an option :P
Anonymous
Or SDL2
SDL2 then?
Anonymous
That's what you reccomend me? Or OpenGL?
Vlad
That's what you reccomend me? Or OpenGL?
OpenGL is gonna be a tough start
Vlad
And I don't think you need much of it's capabilities for 2d
Vlad
And SDL2 is accelerated via OpenGL under the hood anyway
Anonymous
Ok ty
Not snake
Not snake
Anyidea how to resolve this issue on crome.
Not snake
I am connected to internet, Microsoft edge too isn't working
V01D
Oh no
ברני
It says it's blocked
M.Khorram
I am connected to internet, Microsoft edge too isn't working
can you ping something? for example ping 8.8.8.8
Not snake
Not snake
Not snake
If u mean search 8.8.8.8 same issue
Not snake
It says it's blocked
Well on edge it says this
Not snake
M.Khorram
open start menu and type "cmd" it would open the "command prompt then type "ping 8.8.8.8"
V01D
8.8.8.8 is google I think
ברני
I see you have downloads, try maybe to check if it's downloading Somthing
V01D
This is offtopic btw.
V01D
Are you in an office or something
M.Khorram
8.8.8.8 is google I think
yea I wanna make sure it is connected to internet
V01D
where are you
M.Khorram
M.Khorram
what
I stopped the offtopic conversation
V01D
ok
Roxifλsz 🇱🇹
Now I'm expecting an "I" to join
Roxifλsz 🇱🇹
And then a "G"
Roxifλsz 🇱🇹
And so on
V01D
I know where this is going
V01D
And I don't know what to think of it :p
Roxifλsz 🇱🇹
Laugh.
Emir
it's a cppquiz question. I did not understand exactly. Copy constuctor called for y2 object. It's okay. then user declared constuctor (X &) called, why is it happening, why doesn't call move constructor x object too
Engineer
#include <cassert> #include <cstdio> #include <thread> // C++ threads int main() { auto* cpp_thread = new std::thread( [] (int a, long long b, std::string c) -> void { assert(a == 1); assert(b == 2LL); assert(c == std::string("test")); printf("Hello from a thread!\n"); }, 1, 2L, std::string("test") ); cpp_thread->join(); delete cpp_thread; return 0; }
数学の恋人
it says that getopt_long is invalid in C99, but a book suggests me to use it instead of handling args manually, is there any alternative way to do the same? like a new function to do same?
数学の恋人
I included wrong header file hence the warning
数学の恋人
I used bits/getopt_ext.h instead of normal getopt.h
Anonymous
https://leetcode.com/problems/binary-tree-preorder-traversal/ for this problem my code is : https://ideone.com/fork/92sebD for one of the input that is [3,2,1] Its working fine on local g++ compiler but LeetCode compiler give error as: AddressSanitizer: heap-use-after-free on address .......... addresss... I understand this is because of memory leak but couldnt find it in my code, can anyone help ?
-
Hello everyone , i make program to print the last 3 digits of number. The problem is if i input 1000 its show only 0 instead of 000. If i input 1296 its show 296. Can anyone help me ? Thanks
Merazi
divide 1000 by 1000 whats the residual of that? That's why you're getting a zero as a result, the % symbol gets the residual of the division of two integers
Sanjay
Hi
Nisal
Hi
Ammar
#include <string.h> #include <stdio.h> int main() { char in[20]; char *p; size_t len; printf("Enter a number: "); fgets(in, 20, stdin); len = strlen(in); p = &(in[len > 3 ? len - 3 : 0]); printf("Last 3 digits: %s", p); }
ברני
Question.. I can't use "else if" more then once? (one after the other)
ברני
Use else if if(...){} else if(...){} else {}
Yes, but my question if I can't use one after the other Cuz I have like 6 if statement to do