Anonymous
Talula
hows your compile time bro
“Bro” I make programs for embedded systems the program is never bigger than 1MB (by the way I’m not a Bro)
András
Don’t try to teach me programming or C++ read what I do for living to know a bit about me, pointers are useless, as you can do whole C++ program without using pointers.
Of course u can, but sometimes no, and usually your program will wasting a time, just becouse u need use more memory, but u think, that this memory is useless
Anonymous
the way rust deals with memory management seems cool
András
But in different way
Anonymous
look up ownership
Talula
Of course u can, but sometimes no, and usually your program will wasting a time, just becouse u need use more memory, but u think, that this memory is useless
And? In today’s time even embedded systems have 4MB Flash, it should be a problem if I do not have any recursive creation of objects?
Anonymous
And? In today’s time even embedded systems have 4MB Flash, it should be a problem if I do not have any recursive creation of objects?
mem·o·ry leak nounCOMPUTING plural noun: memory leaks a failure in a program to release discarded memory, causing impaired performance or failure.
András
Anonymous
good niht guys
Anonymous
i gotta study more
Anonymous
tomorrow
Talula
i gotta study more
Best of luck...👍🏻
Anonymous
Best of luck...👍🏻
thanks, you are a woman?
Talula
thanks, you are a woman?
Yes... 50% of earth is inhabited by us.
Anonymous
Yes... 50% of earth is inhabited by us.
i want a programming wife lol
Talula
Sorry I’m 32 years old, married and I have a son who is 9 yo.
Anonymous
Anonymous
joke
Anonymous
facebook is using rust for their blockchain
András
And? In today’s time even embedded systems have 4MB Flash, it should be a problem if I do not have any recursive creation of objects?
Okey, no let's do not use recursive function becouse it get a lot of stack memory, and usually you can do the same by loop. Don't use C language, becouse it's is slower that assembly, and use more memory in code segment. Dont use...
Talula
I took it as one... no worries I’m not going to call you when I get divorced... if I get divorced.
Anonymous
char somestring[] = “this is funny”;
Talula
Do u use templates?
Template for what?
András
Template for what?
Oh, I understand. U just use C with classes and STL
Talula
Oh, I understand. U just use C with classes and STL
Mostly, I like to do things fast and not make a program that I would get confused with just next week.
András
It's funny
András
You want more speed, but u don't use one of the most powerful feature to make your program faster than C
Talula
You want more speed, but u don't use one of the most powerful feature to make your program faster than C
Speed in making the program not speed of operation, actually most of the things I do is using library to make things work.
Talula
I have a bad habit of writing big functions and class with least number of methods, bad programmer but I get things done.
András
Speed in making the program not speed of operation, actually most of the things I do is using library to make things work.
I can repeat my last message with swaping "your program" to "time of code writing"
araragi
Yeah sorry I'll edit
Talula
C++ is high level programming language
I think he meant C++ is compiled to true machine code.
András
And my object will still be allocated on the heap
Of course there is a lot of other way to do it, but this is the most popular
Anonymous
András
Are u talking about smart ptr?
Anonymous
Are u talking about smart ptr?
Yes, I'm talking RAII in general
Anonymous
Yes, there are cases where they are not applicable or where are the bad choice, but in most cases this what you need And with them in most cases there will be no new and no pointer
András
Yes, I'm talking RAII in general
Do u think, that Tazz know what that mean?)
araragi
I think he meant C++ is compiled to true machine code.
Yes you got it right. You already know it very well where C has advantages over high level stuff. Just don't tell pointers are useless because we still use them. Hope you understand. Don't take anything personally..
araragi
Yeah, discussion is lit , I'mma read it all
Anonymous
Who?
You
Talula
You
She...
Anonymous
She...
Tazz, as an embedded software engineer, do you use pointers?
Talula
Tazz, as an embedded software engineer, do you use pointers?
Sometimes I have to but I avoid them as much as possible... problem is if I don't free them properly, my controller can run out of memory really fast.
András
She...
Sorry
Talula
Do you write in c++?
Yes, mostly sometimes I have to code in C, which sucks. But yes mostly C++ GCC.
Anonymous
She...
Oh, I got it Sorry
Talula
That mean you have created memory leak. Everything will crash, if there is it
Well the Microcontroller doesn't crash it simply reboots.
Anonymous
Hi I have a doubt in writing a small piece of code in cpp. I need tips as how could it be performed efficiently
Anonymous
#howtoask
Anonymous
And show the code without screen pictures or screenshots Use paste.ubuntu.com, please
Anonymous
Efficient way to perform a task repeatedly after set delay. So let's say there's a while loop which is running iteratively and I have a variable "i" in it which gets updated at each interaction. Now what I'm trying to do is call a function with the set value of "i" in that iteration after few seconds. So far I'm taking a difference between time and check if the difference matches 2 seconds and then call the function in the while loop
Anonymous
One minute I'm sending a pastebin link
Anonymous
Shoot
Mat
the_cornholio: https://pastebin.com/NRDG25Ez
Mohd
#include<stdio.h> #include<conio.h> int main() { int a,b,choice; while(1) { clrscr(); printf("\n1. Addition"); printf("\n2. Substraction"); printf("\n3. Multiply"); printf("\n4. Divide"); printf("\n5. Exit"); printf("\n\nEnter your choice"); scanf("%d",&choice); switch(choice) { case 1: printf("Enter two no."); scanf("\n%d",&a); scanf("\n%d",&b); printf("Sum = %d",a+b); break; case 2: printf("Enter two no."); scanf("\n%d",&a); scanf("\n%d",&b); printf("Substract = %d",a-b); break; case 3: printf("Enter two no."); scanf("\n%d",&a); scanf("\n%d",&b); printf("Multiply = %d",a*b); break; case 4: printf("Enter two no."); scanf("\n%d",&a); scanf("\n%d",&b); printf("Divide = %d",a/b); break; case 5:exit(1); default:printf("Invalid Choice"); } getch(); } return 0; }