Gianni
Hi guys, i'm trying to understand this function in C: Rspiclk (16, Posrc+16*j, (char*)&pDat[j] [0]); I don't understand what does mean the last element of the function. Anyone can help me?
cooper
convert chat** to chat*
Hussein
I was reading some book about databases When I came across Non-volatile memory. I'm wondering what is it? and How can I use it in C?
Hussein
I was reading some book about databases When I came across Non-volatile memory. I'm wondering what is it? and How can I use it in C?
does it refer to the swap partition at the disk or It's something totally different sort of memory?
Anonymous
Any good coder here in any language just wanna ask a question
klimi
Any good coder here in any language just wanna ask a question
you should have instead asked teh quesition
klimi
can u help bro
No I cannot because you haven't really asked your questions
Hussein
I was reading some book about databases When I came across Non-volatile memory. I'm wondering what is it? and How can I use it in C?
guys anyone knows what is meant by non-volatile memory? I know it is some sort of persistant memory but is it refering to the swap partition on the disk? and how to use it in C anyone can help me?
Null
Hi, everyone i have finished C++. And i do'nt know what i will do. I wan to be software engineer. Can anyone help me?
Pavel
guys anyone knows what is meant by non-volatile memory? I know it is some sort of persistant memory but is it refering to the swap partition on the disk? and how to use it in C anyone can help me?
As I understand it refers to HDD/SSD and similar things, so it's memory in broad sense, I guess the main way to work with it through its file system (unless you're writing some OS/drivers/embedded software)
Ven
Hee everyone who know how to store data in Link List when we close program
Pavel
Hee everyone who know how to store data in Link List when we close program
Serialize it to file, then deserialize back on app start
Anshul
https://pastebin.com/n6RrCLqK This is the problem: https://leetcode.com/problems/triangle the solution that i wrote and the solution i found on discussions thread on leetcode both are pretty much same but i don't understand why my solution is giving TLE
Anonymous
Can anyone give a question of array?
Anshul
you can checkout on leetcode
%Nikita
How about adding suffix like 50lf and 60lf ?
Oh yeah. Also you can do 50.0 and 60.0 And more For example double(50) and double(60) And more #define D(a) (double)(a) D(50) and D(60) And more static inline double GetDouble(const int a){ return (double)a; } And how about library? main.cpp: #include "doubles.hpp" #include <iostream> int main(int argc, char **argv){ double x,a,b; a=50; b=60; x = GetDouble(11) / GetDouble(100) * a; std::cout << x; return 0; } doubles.hpp: #ifndef _DOUBLES_HPP #define _DOUBLES_HPP #define DBL(a) (double)(a) double GetDouble(const int); #endif doubles.cpp: #include "doubles.hpp" double GetDouble(const int arg){ return DBL(arg); } Makefile: CC = g++ CFLAGS = -O0 -Wall -ggdb PE = main default: $(PE).out $(PE).out: main.cpp doubles.o $(CC) $(CFLAGS) -o $@ $^ doubles.o: doubles.cpp doubles.hpp $(CC) $(CFLAGS) -c -o $@ $< clean: rm *.o rm *.out And here you go. $: make $: ./main.out 5.5 $:
Aristo
Are there any groups for just C?
klimi
Are there any groups for just C?
Like... where you can ask just C and you won't ever see C++? Or what is the reason for such groups if this group exist for both?
klimi
Yes
don't know about any. Tbh I would just ask in groups that are meant for C as well like this one
数学の恋人
template<typename F> concept SomeConcept = std::is_nothrow_invocable_v<F>; template <SomeConcept F> void doSomething(F&&); doSomething([] { std::cout << "Wowuuu!!!\n" });
数学の恋人
klimi
@K11M1 any ideas?
I really haven't looked onto C++20 yet, so i quite don't get concepts.
数学の恋人
oh ok
数学の恋人
I guess I have to pass it as std::function
数学の恋人
I'll look into it, but do guide me, if anyone can
klimi
Like the only idea that is on my mind is, that the lambda is not "not_throw_invocable"
数学の恋人
yeah right
数学の恋人
I made it std::is_invocable_v<F> and it works properly, errors were being caused by as you suspected, because of std::is_nothrow_invocable_v<F>
数学の恋人
数学の恋人
But yes, nevermind, it works now
klimi
how did you fix?
klimi
Oh right, i see; I should have a look at these new stuff (but my courses we only c++17 so i tried to not look at them :D )
数学の恋人
oh no probs
Pavel
doSomething([]() noexcept { std::cout << "Wowuuu!!!\n"; });
数学の恋人
Thanks @K11M1 and @gameraccoon
İbn
Write a c++ program that returns two values ​​in a function?
İbn
How can I return two values ​​.. or not possible?
İbn
This my homework
İbn
OMG
\Device\NUL
Maybe the function that can return two kind of return value, that's possible using branch
\Device\NUL
But yeah, it's actually returning one value
\Device\NUL
Zamn, rip English
\Device\NUL
How
Like this ? int func(void) { if() return -1: else return 0; }
İbn
Zamn, rip English
Do it please ...and send me
klimi
This my homework
why should we do your homework? this is even worse than you just asking
Alessandro
Hi Devs! I would like to know your opinions using c++ for backend web development. Im creating a our roadmap and im looking for opinions.
pavel
%Nikita
How can I return two values ​​.. or not possible?
You can return pointer to array that has 2 elements
ʙʀʜᴏᴏᴍ ⑇
cout << "Write the number of the movies that you want to see them (to quit, press (q)) "; int value = 0; vector <int> num; for (int i = 0; i < 10; i++) { cin >> value; if (value != 'q') { num.push_back(value); } else break; } num. shrink_to_fit(); cout << "\n\nThank you" << user_name <<< " for being one of our clients\n"; cout << "All your tickets are in the file down below:"<<< endl; ofstream ticket ("Tickets.txt"); if (ticket.is_open()) { ticket << "Thank you" << user_name << " for being one of our clients\n\n"; for (int i = 0; i < num.size(); i++) { int v = num[i] 1; ticket<<<num [i] << ticket << movie_name[v]; ticket << endl; } }
ʙʀʜᴏᴏᴍ ⑇
I write only 10 to 5 then I press 'q' to quit But still print some of my arrays!!
ʙʀʜᴏᴏᴍ ⑇
I cant send the pictures here so if can I send it to anyone know vectors in c++ in private!!?
pavel
I write only 10 to 5 then I press 'q' to quit But still print some of my arrays!!
You don't need shrink to fit. And check break conditions, like break doesn't work
Anonymous
i really suggest you to use builtin, it's fast the compiler only needs to check for OF (overflow flag) on x86 if you use the builtin https://godbolt.org/z/rMdxzz1vz
true but it also needs to actually perform the arithmatic which may be more expensive than determining if such would overflow
Anonymous
i really suggest you to use builtin, it's fast the compiler only needs to check for OF (overflow flag) on x86 if you use the builtin https://godbolt.org/z/rMdxzz1vz
additionally some languages (eg C#) simply throw an exception when such is detected which can be much slower than simply checking beforehand if it will overflow
pavel
You can check how large number libraries works. Such libraries check overflow flag to increment high part on large number