Serenity
for example
Serenity
I enter a string : "1121111..." , it doesn't go one line down , it just keeps filling the second string ..
Anonymous
i think you got the current design wrong struct Quote { virtual double net_price(quantity) const; // price of quantity items (needs access to price) protected: double price; // price of one item } struct Bulk_quote : Quote { double net_price(quantity) const override; // price of quantity items (needs access to price from Quote and discount quantity and amount from Bulk_quote) } struct Limited_bulk_quote : Bulk_quote { double net_price(quantity) const override; // price of quantity items (needs access to price from Quote, discount quantity and amount from Bulk_quote, max numbers discounted from Limited_bulk_quote) } you are saying to move the stuff related to discounted numbers to an abstract class. but the price of a single item still comes from the base class.
Anonymous
I enter a string : "1121111..." , it doesn't go one line down , it just keeps filling the second string ..
i don't get you either. what do you mean by go one line down? it's the input stream, user should press enter for that
Anonymous
oh. thanks
Dima
Anyone here please give me a road map to become a successful software developer
If you are asking such questions you are already unsuccessful
MᏫᎻᎯᎷᎷᎬᎠ
Shahram
Hi, Rose, Thank you.
noop
Anyone here please give me a road map to become a successful software developer
This is the mentality of asian people to always ask for someone to guide them. Be independent and use google.com instead
_ghost
I was recently playing around with compiler explorer by Matt Godbolt and I was wondering about the assembly code generated for C and C++ programs, so, Is there any good resources available for learning assembly language in context of understanding the code generated by the compiler for C and C++ programs?
A
Why I can't enter 2 inputs from user with unknown length of char pointer? It just ends the program after first input
A
char *str1; char ch; str1 = (char*)malloc(sizeof(char*)); printf("Enter a sentence:(Ex: Computer Engineer)"); str1 = (char*)malloc(sizeof(char*)); scanf(" %s", str1); printf("Enter a character to search(Ex: g):"); scanf(" %c", &ch); char *result; result=mystrchr(str1,ch); if(result!=NULL) printf("%s",result); else printf("NULL");
Anonymous
neither pointers, nor arrays
Anonymous
i think you should read about all three from some book
noop
free, not delete[]
That is right.
noop
Yes, but it is a good habit to avoid mistakes
A
that's not how malloc works
I wrongly added two lines of str1 = (char*)malloc(sizeof(char*)); do you mean his? Yeah I am not good at it obviously
Anonymous
I wrongly added two lines of str1 = (char*)malloc(sizeof(char*)); do you mean his? Yeah I am not good at it obviously
malloc(sizeof(char *)) allocates 8 bytes (assuming object pointers are that long)
Anonymous
printf("%zu\n", sizeof(char *)); to test
Artöm
I wrongly added two lines of str1 = (char*)malloc(sizeof(char*)); do you mean his? Yeah I am not good at it obviously
When you allocate memory for string, you should pass buffer size like malloc(32), it will be able to hold 31 chars + \0
Anonymous
no. malloc returns a void * and takes in a size_t. he can store a string in there if he wants to, it won't be undefined behaviour. but the length of the string (including null) can be at most sizeof(char *)
A
malloc(sizeof(char *)) allocates 8 bytes (assuming object pointers are that long)
it should be like this then? str1 = (char*)malloc(sizeof(char*)*(strlen(str1)+1));
Anonymous
it should be like this then? str1 = (char*)malloc(sizeof(char*)*(strlen(str1)+1));
strlen(str1) doesn't exist before the existence of str1
Anonymous
it should be like this then? str1 = (char*)malloc(sizeof(char*)*(strlen(str1)+1));
to get a string of unknown length use getline() (POSIX) or write a getline() yourself (windows). but first read about arrays, pointers, memory management
Anonymous
yes. but he can store a string as long as it fits in the size of a char pointer
Anonymous
true
Anonymous
👨‍🎓
Nils
Hi, how can I convert a integer to a char array without including any headers?
Nils
Cast
No, I want to convert it to a human readable one
Nils
syntax error
Nils
aah you corrected
Nils
thank you
Dima
Lol
Nils
I didn't see it. oops
Amit
Hello ,i downloaded MinGW.exe file .....but i cannot fild .bin file here to choose path ....i download visual studio code
Amit
Find*
_ghost
Can you tell me in detail about list of numbers you generated i.e. 1110, 1100, 1010, 1000, 0110, 0100?
Nils
Hi, I am trying to write a function that iterates through a buffer until it has data: https://del.dog/stanygrina.c I am initialising kb_buffer like this: static char kb_buffer[256] = {0}; And it gets stuck. Any idea?
Anonymous
Hi, I am trying to write a function that iterates through a buffer until it has data: https://del.dog/stanygrina.c I am initialising kb_buffer like this: static char kb_buffer[256] = {0}; And it gets stuck. Any idea?
also, the name of the function is terrible. getchar() can be implemented as a macro if an implementation wants #define getchar() fgetc(stdin) this will break your code easily
Anonymous
Hello Admin, I have a question, recently I have developed 2D platformer game using Unity3d game engine and I have published the game to web platform and I made the complete development open-source on my Github. So can I share my development links in this group? Please let me know
Can
I’m pretty sure you did not just read the rules under 60 seconds
Can
read the rules and do you
Nils
I have to provide these functions myself.
Nils
😅
Anonymous
Shvmtz
Hey
Shvmtz
Program to swap two numbers using pointer with structure
klimi
?
?
Dima
Program to swap two numbers using pointer with structure
/warn read the rules, no assignment requests
Shvmtz
Sanjeev Chary HCL NAGARAM Hyderabad
✋ any one knows Web scraping Message me 9398067734 personally to me Thanks Acharya
Dima
Bruh.
Anonymous
Hello! If you know other C/C++ groups, please send me the link in pm
klimi
Bruh.
whew
Anonymous
why?
The more, the merrier!
klimi
ok, if that is so, check telegram group listing
Brax
Any professional who van handle this?
Brax
C*
Brax
All professional web designers and developers need a portfolio to display their work to prospective clients. By completing the projects in this book, you have created a number of different examples that showcase your Dreamweaver skills.Note: There are no Student Files from the publisher.1.      Create a new local site (be sure to define remote site as well)2.      Follow steps located at the top of the page which require a(n):a)      Sketchb)      Brief explanation behind your final design (Word document, sketch may be added to file by inserting an image, then add to local site folder)3.      Complete art director steps located under "To complete this project"4.      Read Client comments and complete client requests5.      To submit your lab, you will need the URL for your website.a)      Test before you submit to make sure it works!b)      Copy & paste the URL into the comment box on the File Upload tab6.      Create a zipped folder of your local site folder (on your hard drive) (see directions below on how to create a zipped folder)7.      Name your zipped file with your LastNameFirstInitial_Lab8 as the file name
klimi
Any professional who van handle this?
i think they are quite many people who could do that....
Brax
Thanks buddy. What of you?
klimi
I am doing my HWs
Brax
Success..
Blue
Hello
Blue
Can anyone help me in making dll codes for application integration
Nils
Hi, I am having problems with the extern keyword: I do "static int kb_block = 0;" in one file and "extern int kb_block;" in the other one. It results in: "kernel.c:(.text+0x262): undefined reference to `kb_block'" But the same works with regular functions. Why?
Nils
Lol, solved right after sending this message: simpy remove the static keyword. I promise I searched one hour to find that out