Anonymous
I cant understand it
Anonymous
what I need to do when learning that
Anonymous
I need some information about data structures in C++
Anonymous
Can someone explain that what basics include in Cpp
Anonymous
Please list them
Adams Scott
When i compile it does not give the desired output
Anonymous
Adams Scott
Its ok i got the problem
Egro
Hey, I started c++ as my first coding language ever. I started April 2021. I am reading from a text book c++ primer. But was told to develop a project in c++ to learn the language faster, also to have that project to show during future job interviews. Now, when I start a project, I am drown in information, and get lost, like a debugger c++ project; the syntax I found as examples to follow from, I am lost, also was told to do leetcodes , when go on there idk how to solve the problem. Now, should I just focus on the text book route? Also, I will go back to school in fall 2022 to switch major to cs
Adams Scott
You need 2 tell it to :)
I solved the problem
Anurag
Can anyone one help me in my college project ?
Anurag
Okay
Egro
What projects have u tried to make?
The only think close to a project I have done so far is input and out put I manipulate to create my own version with small iterations; which I got from the text book as examples, these are the only project
Egro
But I am passionate about coding but the text book route is dry and also informative, but I feel useless, it’s 1000 pages and I’m on page 253
Egro
And where did u 'get lost'?
I don’t get lost in these small projects , idk if they are even projects
Anonymous
I don’t get lost in these small projects , idk if they are even projects
For starters, it is. Have u tried making an application? Maybe a small library?
Egro
For starters, it is. Have u tried making an application? Maybe a small library?
No, idk how to start. I thought of making a library that hold books I have read, but idk how to even make a pop up window, when I look up how, I see some codes way out of my leagues
Egro
Okay, I’m on window and using, visual studio. And thank you, I will look into winapi
Egro
Thank you so much . I ever knew about winAPi
Egro
Never *
Anonymous
Thank you so much . I ever knew about winAPi
Np. The WinAPI is how every userspace application does stuff (the standard library uses it behind the scenes aswell)
Anonymous
And it includes an API for creating Windows
Egro
Ohh, I was thinking . To making a application I need to code it out , like build the applicant with code “if that make sense “
Egro
But I start this new library to hold books as my first project.
Egro
I’m looking up winapi now
Anonymous
Their API gets hate just because it's Microsoft lol But it's very good Well, maybe not 'very good', but it's good
Egro
At his points idk anything about api, I am ** putting your advice at work and searching the web on windowapi , learning what a api and how to use it
Egro
I found something, win32 and c++ … now, should I concern myself if my system is 64 bit, or don’t worry about the name “win32” I’m thinking it’s 32 bit
Egro
This is in parallel with my search on winapi , I found a link on using win api usage
Egro
Never mind, via reading I learn, winapi is compatible with both 32 and 64 bit 😁
Anonymous
I call every Windows app a Win32
Anonymous
Unless its UWP or some managed stuff
Anonymous
Just try and play with it and make mistakes
Egro
I will, but side track learning about Hungarian notation; the article I found mention, I will see a lot of this , so I’m learning what it is
Crbala
I found something, win32 and c++ … now, should I concern myself if my system is 64 bit, or don’t worry about the name “win32” I’m thinking it’s 32 bit
Greetings It really matters example we have written softwares which are 32 bit and used C++ 32 bit one. In one of the product we literally translated the linux calls to winmain events and handled it in c++ 32. Some examples are Amdocs Kenan and initial version of Netcracker and Geneva iniital Billing System Cramer all were written in 32 bit Now the challenge we encountered was OS were upgraded from 32 bit machine to 64 bit machine but the software processes were still 32 bit and its memory can't be utilized more that 2 power 32. So we had to rewrite the code in c++ 64 bit version for some of the softwares. AFAIK till 2019 kenan was still in 32 bit after that I moved on.
Egro
My vocabulary is expanding… component object model (COM) .. tempted to Dive into this but , I’ll digress and focus on the actual winapi building.
Egro
Gonna take a break, read so much, Learned of memories and pointer (just learn, pointer have sizes ) , then ended on, windows. Windows within a window , and parents and child window. Gonna eat a apple and come back
Anonymous
Hi there How do vector::at function works
Golden Age Of
its the same concept as [ ], but it checks getting out of range
Golden Age Of
So it works a bit slower
Unknown
Fun Question A=3 Printf("%d %d %d",A, ++A, A++); What will be answer RuleS do not search Do not check see and answer
Ammar
It's UB.
Unknown
Harshal
It's UB.
+1 https://stackoverflow.com/questions/4176328/undefined-behavior-and-sequence-points
● Igor
i'm really having a hard time to find it... how can i ignore an specific char with cin? with scanf i think it is scanf("%*c"), but i can find anything like this for cin
● Igor
i'm reading multiple lines like this: P 5 T 1 4 P 7 T 4 7 with this code: for (int i = 0; i < I; i++) { char C; int A, B; cin >> C >> A >> B; }
● Igor
Anonymous
not exactly, I want to read this P's and T's to variable C
Ok. So what do you want to ignore in your case? I am not sure I understand what you want
● Igor
lemme check if it is not some other mistake... brb
● Igor
for (int i = 0; i < I; i++) { char C; int A, B; cin >> C >> A if (C == 'T') cin >> B; }
Anonymous
isn't that for multiple chars?
What I meant is that suppose you have a phone number in the formate 1-408-1234, you can get the individual components like this getline(cin, centre, '-'); getline(cin, area, '-'); getline(cin, phone);
Ludovic 'Archivist'
Anonymous
for (int i = 0; i < I; i++) { char C; int A, B; cin >> C >> A if (C == 'T') cin >> B; }
Yes for your case, this is how you should do it. getline or ignore won't help as you are not ignoring anything. I guess you meant to say you want to ignore input into B if C != 'T'. There is no easy way to do it in C++ AFAIK.
Anonymous
Sad no ufcs will always make me sad
D had it but unfortunately that language is done and dusted. After all the hype surrounding it, even it's maintainers (especially Andrei) have lost interest in it. Rust is currently where all the action is
Anonymous
I agree it would make it much easier to chain calls and my use case would have been more pleasing on the eyes
Anonymous
I just read that Bjarne had been pushing for it since C++14 but it has been rejected many times
Ludovic 'Archivist'
I just read that Bjarne had been pushing for it since C++14 but it has been rejected many times
I actually understand why. It makes debugging harder and gives new template and argument deduction shenanigans to do, as well as making things conflict more
Ludovic 'Archivist'
All I want for Christmas is static reflection
Ludovic 'Archivist'
Give me static reflection and i am the 2nd happiest being alive
Ludovic 'Archivist'
Give me static reflection and i am the 2nd happiest being alive
* this statement may be an exaggeration, may contain crippling depression
Anonymous
I actually understand why. It makes debugging harder and gives new template and argument deduction shenanigans to do, as well as making things conflict more
Well it is not actually that hard to implement. Method calls resolution is the easiest of all in C++. It is free functions where we have an issue with ADL and stuff. All that needs to be done is to resolve a call as a method call and if a method is found and the arguments match then call that. If it doesn't match the arguments then flag a compiler error. If no method was found, assume it was a free call and do the normal search. I don't see why this would complicate things. And for templates, concepts can be extended to insist on method calls resolution only if it is so required
Anonymous
I actually understand why. It makes debugging harder and gives new template and argument deduction shenanigans to do, as well as making things conflict more
And as far as debugging being harder, I could argue that it makes it easier to find free functions by just using the method call notation in an IDE. So it helps with development
Ludovic 'Archivist'
And as far as debugging being harder, I could argue that it makes it easier to find free functions by just using the method call notation in an IDE. So it helps with development
Have you never spent 2 hours fiddling with the wrong function overload in search of a dumb bug or gotten hit on the head when implementing a function with the same name as another in a different namespace?