C++ programming at a state college

>C++ programming at a state college
>already know it, just have to get the credits, should be easy
>instructor currently teaching dynamic memory allocation and deallocation using new and free()
>mfw

Other urls found in this thread:

isocpp.org/wiki/faq/freestore-mgmt#mixing-malloc-and-delete
stackoverflow.com/questions/240212/what-is-the-difference-between-new-delete-and-malloc-free
twitter.com/AnonBabble

If they're going to teach memory management I don't understand why they wouldn't use C. The C++ they're teaching is just C with classes anyway.

True and all but here's the problem

isocpp.org/wiki/faq/freestore-mgmt#mixing-malloc-and-delete

stackoverflow.com/questions/240212/what-is-the-difference-between-new-delete-and-malloc-free

You can't mix them

You sure you should be attending that university?

I don't get it, what's the problem?

It's really dumb to have that attitude when you go to college. Just be interested even if you already know. It will make your time much more enjoyable.

Let me guess, they are teaching you pre-C++11 C++?

That's a good thing user. Just because you already know something doesn't mean you should ignore it. You could learn something new, and you're paying for the class anyway so you might as well try to get some value out of it.

> teaching undefined behavior

RIP OP
You're welcome at the ##c++-social suicide prevention hotline on freenode.

>missing the point this hard
I guess it's a bit subtle

Just bring your laptop to class and do something else when they are teaching stuff you already know. The attitude you have is dangerous. You need to be opening to learning from others even if they are teaching something you already know. There are always new things to learn here and there.

>Java programming at a state college
>already know it, managed to test out of the first class
>GPA isn't high enough to get into computer science
>settle for computer engineering and learn a bunch of verilog and a little C++
It'll get better by your junior year, but by then you'll be sick of school. I just want to graduate on time. ;_;

It's not subtle. I was asking a question unrelated to that.

>Be OP
>Can't afford a journal
>post on Sup Forums instead

You're not supposed to be using malloc in C++.

even the ones correcting the C++lets are wrong
fucking christ

kek

>be in college
>be dumb af
>be cocky
I hope you open your mind sometime.

Please explain to me when you'd want to use 'malloc' and 'free' in an intro C++ class or why you would ever want to mix them in an intro C++ class.

To the brainlets in this thread: the problem is that you can't free() an object that was newed, you have to use delete. It's like trying to copy a string to a bool.

because you refuse to listen to your instructor, why should we tell you? You obviously have this world figured out, and you're on your way to becoming the world's best programmer. Holier than thou.

Yeah, and that was the fucking second reply to the thread

>why should we tell you?
Because you aren't talking to the OP? I can think of reasons why C style allocations and deallocations would be useful, but I can't see how they would be in an intro class. More importantly, why are 'new' and 'free' being mixed? Even if that does have some useful behavior, why would a class of intro students need to know that?

OP here. Yes, it's pre C++11, curriculum outdated af

There's nothing wrong with using malloc.

That guy isn't me, user. but about this:
>you refuse to listen to your instructor
Yeah, you shouldn't listen to anyone who tells you to mix new and free()

>why are 'new' and 'free' being mixed? Even if that does have some useful behavior
It doesn't, unless you think "undefined behavior" is useful

>he thinks he can code
>thinks he's too good for class
>can't even quicksort
>mfw

you're a brainlet and doomed to fail. If you already know C++ and are STILL attending CS classes instead of doing your own FOSS and commercial projects and padding your resume you're not going to be a programmer

also you probably barely know C++ past the basics

OP what is the point of this thread

this has to be bait

>you're not going to be a programmer
thank god

>why are you getting a bachelor's if you already know C++
you're clueless

>also you probably barely know C++ past the basics
project harder

It's not. What are your thoughts?

typically, in terms of GPA, and workload, computer science is far less demanding than ECE

The way my school worked, you needed to transfer from general engineering into a specific major, but the majors were competitive and had GPA cut offs. I agree that Computer Science is less demanding, but that's why it's harder to get into. Everyone else wants to be in it so they can study web design and mobile development instead of signals or differential equations.