473,832 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Your C++ Homework

I used this site for a c++ homework assignment that my teacher left me no
clue on how to do it. http://www.betterteachers.com. Check it out.

Fred
Jul 22 '05
31 2234
"JKop" <NU**@NULL.NULL > wrote:
Jonathan Turkanis posted:
"JKop" <NU**@NULL.NULL > wrote :
Since when does one need a teacher to learn C++?!

I'm living proof of the contrary.
I wouldn't stress that one example too much.

Any particular reason why?


I was trying to express what I thought was a pretty obvious point without being
overtly rude. As is so often the case, I probably should have kept my mouth
shut.
-JKop


Jonathan
Jul 22 '05 #21
"JKop" <NU**@NULL.NULL > wrote in message
news:dz******** ***********@new s.indigo.ie...
Given that you recently threw one on line fit because you couldn't add
an integer to a string and another because you couldn't return a stream
by value, I would say this proof is a little leaky.

Actually, don't you think that destroys your own argument? You've just
expressed that at one time I didn't know how to append a number in digit
form to a string, and that I didn't know why a stream could not be copied.
Evidently, I posted enquiring about these, and now I know how. Emphasis on
"now I know". Quit living in the past.
-JKop


On 10/23/2004
"JKop" <NU**@NULL.NULL > wrote in message
news:D8******** ***********@new s.indigo.ie...
Hello!

I'm an expert C++ programmer.


-Mike
Jul 22 '05 #22
On Wed, 27 Oct 2004 12:40:03 +0300, "Catalin Pitis"
<ca***********@ iquestint.com.r enameme> wrote:

"Gernot Frisch" <Me@Privacy.net > wrote in message
news:2u******* ******@uni-berlin.de...

"Catalin Pitis" <ca***********@ iquestint.com.r enameme> schrieb im
Newsbeitrag news:2u******** *****@uni-berlin.de...

"JKop" <NU**@NULL.NULL > wrote in message
news:LR******** ***********@new s.indigo.ie...
Definitely agree with you there! While having a teacher (for anything in
life really) will make you learn faster, still there's no need for the
teacher. I've yet to find a book which has a good explanation on why:
int *p_k;

*p_k = 4;
is illegal.

When you find it, tell me :). I'm curious.


Don't understand: Is there no book that tells you that it's illegal? I'm
gonna write one. Title:
"Dereferenc ing an uninitialized pointer is illegal".

Content:
Dereferencing an uninitialized pointer is illegal. Example:
int* p_k; *p_k=4; [1]

References:
[1] JKob in comp.lang.c++, 27.10.2004

Am I gonna be rich?
-Gernot


It should be a missundertandin g :). By illegal I meant that the compiler
doesn't allow me to do it. But I'm allowed to do it. I surely wouldn't do it
:).


The compiler generally issues a warning in that case. It doesn't block you
from doing it (since the standard merely says it's undefined rather than an
error), but alerts you in case you forgot to do somethine first.

The piece of code is only stated to be undefined under general standards. A
compiler doesn't complain because there is a chance that the variable may
be initialized somehow (but I doubt it). As a result, the only problems
you encounter will be at run-time (or in the case of old dos programs, a
"null pointer assignment" message on shutdown.)
Jul 22 '05 #23
Raymond Martineau wrote:
The compiler generally issues a warning in that case. It doesn't block you
from doing it (since the standard merely says it's undefined rather than an
error), but alerts you in case you forgot to do somethine first.

The piece of code is only stated to be undefined under general standards. A
compiler doesn't complain because there is a chance that the variable may
be initialized somehow (but I doubt it). As a result, the only problems
you encounter will be at run-time (or in the case of old dos programs, a
"null pointer assignment" message on shutdown.)

Assignment of an integer to a pointer type is not allowed, unless some
"dirty" casting is used.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 22 '05 #24
Jonathan Turkanis posted:
"JKop" <NU**@NULL.NULL > wrote:
Jonathan Turkanis posted:
> "JKop" <NU**@NULL.NULL > wrote : >> Since when does one need a teacher to learn C++?!
>>
>> I'm living proof of the contrary.
>
> I wouldn't stress that one example too much.

Any particular reason why?


I was trying to express what I thought was a pretty obvious point
without being overtly rude. As is so often the case, I probably should
have kept my mouth shut.
-JKop


Jonathan

Curious, that's all.
-JKop
Jul 22 '05 #25
Mike Wahler posted:
"JKop" <NU**@NULL.NULL > wrote in message
news:dz******** ***********@new s.indigo.ie...
> Given that you recently threw one on line fit because you couldn't
> add an integer to a string and another because you couldn't return a
> stream by value, I would say this proof is a little leaky.

Actually, don't you think that destroys your own argument? You've just
expressed that at one time I didn't know how to append a number in
digit form to a string, and that I didn't know why a stream could not
be copied. Evidently, I posted enquiring about these, and now I know
how. Emphasis on "now I know". Quit living in the past.
-JKop


On 10/23/2004
"JKop" <NU**@NULL.NULL > wrote in message
news:D8******** ***********@new s.indigo.ie...

Hello!

I'm an expert C++ programmer.


-Mike

I presume that was to a Win32 newsgroup, no?

The term "expert" is relative. Outside of this newsgroup, I would definitely
say that I'm an expert C++ programmer, but if I were to say that right here
then it wouldn't have much weight as there's people here with superior
knowledge of C++ than me (in particular, of the Standard Library... it
really is about time I got a book on it!).
If we throw the Standard Library out of the window for the moment, then I
would be comfortable saying here that I'm an expert C++ programmer - I
pretty much understand and know how to use all of the features of C++.
Anyway Mike, thanks for clarifying whatever the hell you were trying to
clarify.
-JKop
Jul 22 '05 #26
Ioannis Vranos posted:
Raymond Martineau wrote:
The compiler generally issues a warning in that case. It doesn't
block you from doing it (since the standard merely says it's undefined rather than an error), but alerts you in case you forgot to do
somethine first.

The piece of code is only stated to be undefined under general
standards. A compiler doesn't complain because there is a chance that
the variable may be initialized somehow (but I doubt it). As a
result, the only problems you encounter will be at run-time (or in the case of old dos programs, a "null pointer assignment" message on
shutdown.)

Assignment of an integer to a pointer type is not allowed, unless some
"dirty" casting is used.

void* const address = reinterpret_cas t<void* const>(666);
Not ttoooo dirty.
-JKop

Jul 22 '05 #27
I actualy bought one and found that it had a number of really
quite trivial mistakes ¬_¬.

Money to burn...
-JKop
Jul 22 '05 #28
On 2004-10-27 02:17:09 -0700, "Gernot Frisch" <Me@Privacy.net > said:

"Catalin Pitis" <ca***********@ iquestint.com.r enameme> schrieb im
Newsbeitrag news:2u******** *****@uni-berlin.de...

"JKop" <NU**@NULL.NULL > wrote in message
news:LR******** ***********@new s.indigo.ie...

Depends on the teacher. With a good teacher(s), you may learn faster
and spend less time for digging in books, manuals and other materials.
I missed that a lot. But I took care to guide other's study in the
companies that I worked.
Definitely agree with you there! While having a teacher (for anything in
life really) will make you learn faster, still there's no need for the
teacher. I've yet to find a book which has a good explanation on why:
int *p_k;

*p_k = 4;
is illegal.


When you find it, tell me :). I'm curious.


Don't understand: Is there no book that tells you that it's illegal?
I'm gonna write one. Title:
"Dereferenc ing an uninitialized pointer is illegal".

Content:
Dereferencing an uninitialized pointer is illegal. Example:
int* p_k; *p_k=4; [1]

References:
[1] JKob in comp.lang.c++, 27.10.2004

Am I gonna be rich?
-Gernot

So, if I have a pointer to an int that's unitialized, how do I tell it
to point at a given int?

Jul 22 '05 #29
Joe Van Dyk posted:
On 2004-10-27 02:17:09 -0700, "Gernot Frisch" <Me@Privacy.net > said:

"Catalin Pitis" <ca***********@ iquestint.com.r enameme> schrieb im
Newsbeitrag news:2u******** *****@uni-berlin.de...

"JKop" <NU**@NULL.NULL > wrote in message
news:LR******** ***********@new s.indigo.ie...

> Depends on the teacher. With a good teacher(s), you may learn
> faster and spend less time for digging in books, manuals and other
> materials. I missed that a lot. But I took care to guide other's
> study in the companies that I worked.
Definitely agree with you there! While having a teacher (for
anything in life really) will make you learn faster, still there's
no need for the teacher. I've yet to find a book which has a good
explanation on why:
int *p_k;

*p_k = 4;
is illegal.

When you find it, tell me :). I'm curious.


Don't understand: Is there no book that tells you that it's illegal?
I'm gonna write one. Title:
"Dereferenc ing an uninitialized pointer is illegal".

Content:
Dereferencing an uninitialized pointer is illegal. Example:
int* p_k; *p_k=4; [1]

References:
[1] JKob in comp.lang.c++, 27.10.2004

Am I gonna be rich?
-Gernot

So, if I have a pointer to an int that's unitialized, how do I tell it
to point at a given int?


int* p_k;

int a = 1;
int b = 2;
int c = 3;
int d = 4;

p_k = &a;

*p_k = 4;

p_k = &b;

*p_k = 3;

p_k = &c;

*p_k = 2;

p_k = &d;

*p_k = 1;
-JKop
Jul 22 '05 #30

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2220
by: python-help-bounces | last post by:
Your message for python-help@python.org, the Python programming language assistance line, has been received and is being delivered. This automated response is sent to those of you new to python-help, to point out a few resources that can help with answering your own questions, or improve the chances of getting a useful answer from the helpers. The most comprehensive overview of python.org help resources is at ...
0
1806
by: | last post by:
I have this question for homework in an intro perl class, I was hoping for some quick help on this please...here is the question Using the Perl programming language, please prepare the following script: Description Given a table 'mailer' that has a column: emailaddr varchar(255) Create a new table to hold a count of email addresses by their domain name limited to those domains that have at least 100 addresses in the list and add a...
2
2283
by: N3TB1N | last post by:
Let me try again. I could use some help with this assignment, even though my teacher does not grade assignments.but because I need to know this stuff for a test very soon, but haven't been in class for awhile and don't know what I'm doing. I have included my (probably wrong) answers for the first few questions. It would be great if someone could tell me what is missing or what I need to work on at least just for the first few. I...
19
1902
by: Guy | last post by:
If you are tired of trying to timely backup your project you should read this message. Relative Reversion is a new innovative product that will not only schedule your backup sessions incrementally, but it will also manage the number of backup snapshots that you want to keep on your storage media. Older backup snapshots are cleared automatically per your specifications, which makes room for newer backup snapshots to be stored. All the...
8
1535
by: jane | last post by:
like, my homework is due at 4:30 pm central time Nov 19, and this stupid professor has no respect for my need to use my time elsewhere. He thinks that if the braces are off, then there's something wrong, but I got my braces off while dating Billy 2 years ago, and I was hotter, so I could start dating Chad on the hockey team. It's so nice to have a friendly place to talk about things:-) Anyways this professor wants me to use c to hurl a...
6
1747
by: wandafoda | last post by:
Sorry guys....another homework question and if you don't wanna help out..i understand. just to say..im' a chemical engineer and we are required at will to do whatever...thast why i have to take C++ and would like to also understand what im' doing.....to further my career.. i'll include the program after the description So my teacher gave the class an algorithm we have to manipulate......its a struct and i understand what is going on in...
6
1222
by: Nep Tune | last post by:
It goes like the following: Use AdventureWorks database and HumanResources.Department table. Create a stored procedure called spDepartmentAddUpdate. This procedure accepts two parameters: Name, and GroupName. The data types are VarChar(50), and VarChar(50) respectively. Define logic in this procedure to check for an existing Department record with the same Name. If the department record exists, update the GroupName and ModifiedDate....
103
6891
by: Tom | last post by:
How do we get out of the browser infinite loop quicksand when we navigate to web pages designed to lock us in and force us to hit the "pay me" button (whatever they want to force you to do)? These are just a sample of nasty quicksand web pages I've run into which lock your browser into a loop and won't let you get out until you hit the "install" or "run" or "OK" button... (whatever it is they want you to do). http://www.spywareiso.com...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10781
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10499
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10541
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9320
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4421
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3078
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.