Ludovic 'Archivist'
Because in this case the default constructor would be called, am I correct?
Yes, if you use new or the array new without parameters, it calls the default constructor, assignment of a pointer (including nullptr) never calls the constructor by itself
🐉
then let's say I have this cin method istream & operator >> (istream& in, Bar& N) { in>>N.size; N.max = (N.size)*2; for (int i=0; i<N.size; i++) in>>N.fooArray[i]; //calling the Foo class istream method return in; } would there be problems?
🐉
because if it's already pointing to a nullptr, when will it point to a dynamic array with size and capacity??
klimi
Cool
klimi
Welcome
🐉
You need to call new[] here
so I should delete the N.fooArray and make a new N.fooArray?
🐉
maybe not even necessary to delete it since it doesn't point to anything
Artöm
You should
Artöm
It might, so delete it first
🐉
You should
It seems like "N.arrayStrum = new Strumento [max];" throws an error in the compiler
🐉
expression in new-declarator must have integral or enumeration type
🐉
woops nvm I forgot to write N.max
destroyed
Bla bla
Maria33
I’m doing a program in C. I have created a graph in the format png. With Windows if you type ‘display image.png’ you can visualize the image, but if I’m using a Mac there’s a message that appears in the word ‘display’ that says ‘invalid command’.
Maria33
Does anyone know which word should I use instead of display when I’m using a Mac. Thanks!
Dima
Bash command
Dima
Execute as a bash command
Diypa
Hi
Asdew
Just ask your question.
Diypa
Solved the problem on my own...
Loner〽💻
Hi...I have been trying to use graphics.h in codeblocks but it does not work...i I have tried following some procedures from google but nothing works...i just get ".xe has stopped working". What might be the problem??
Loner〽💻
Loner〽💻
Thats the sample code
Loner〽💻
Dima
jpeg
Loner〽💻
and that is what i get after runnimg the code..
Youssef
Can i compile c source code with c++ compiler?
Dima
yes
Caio
"kind of vector one"??? Do you mean std library?
Not exactly, i mean a library that can save multiple data and has a easy and simplified management, like phyton does with “lists”
Caio
Better in what?
Array data administration
Anonymous
hi how can i jump from catch scope to try scope without nothing gets cleaned up in try codes ( from where it remains )
Sidharth Kumar
Ho
Sidharth Kumar
What's the most advanced topic of c++?
Sidharth Kumar
Anyone going to answer my question?
Asdew
What's the most advanced topic of c++?
May I just ask why you want to know that?
Asdew
I'd say that at least one of the hardest is the name. It's C++, not c++.
Ludovic 'Archivist'
Ludovic 'Archivist'
Nobody delves into it so it is the most advanced topic
MᏫᎻᎯᎷᎷᎬᎠ
Locale faucets
What is it?
Ludovic 'Archivist'
What is it?
https://en.cppreference.com/w/cpp/locale/locale
Thanveer
Where's that
Thanveer
Kk got it
Daniele
is there a way to read text from a specific line of a file?
Daniele
I have a file with 2 lines and I need to read the second one, how can I do this?
Anonymous
Use object method
Anonymous
Or use heroine function if you are trying to read a sentence
Anonymous
Can i compile c source code with c++ compiler?
It is recommended to write portable codes; however it is possible to write a valid C program which is not valid in C++: struct operator { const char *name; }; int operator(const struct operator *, int, int); int main(void) { for (int try = 0; try < 10; ++try) operator(NULL, 0, try); return 0; }
Daniele
Or use heroine function if you are trying to read a sentence
trying to read a list of numbers on the same line, what I'm trying to use is fscanf
Daniele
also, the number of elements in the file is unknown, so I cannot really use fscanf
Artöm
is there a way to read text from a specific line of a file?
No, file is not array, it doesnt know about amount of lines
Daniele
No, file is not array, it doesnt know about amount of lines
alright so about the fscanf issue, how do I read stuff from the file and increase a counter for each time I find a new string?
Artöm
Do you need whats inside the lines?
Artöm
If not, read charwise or blockwise and count newlines
Anonymous
Does any 1 here have resources on how to get started in driver development for windows but in (modern) c++ instead of c?
Sidharth Kumar
Sidharth Kumar
Sidharth Kumar
Someone please give your helping hands
Mat
#howtoask
Mat
^
Sidharth Kumar
I am a school student btw. I got this problem in my cybertronics Olympiad .
Sidharth Kumar
I was unable to solve this problem
Francisco
I was unable to solve this problem
Give it a try, and come back later with what you've done so far
Anonymous
lol
Dima
lol noobs
I_Interface
Dima
including you
I_Interface
klimi
Whew