comp.lang.c++
  Home FAQ Contact Sign in
comp.lang.c++ only
 
Advanced search
March 2007
motuwethfrsasuw
   1234 9
567891011 10
12131415161718 11
19202122232425 12
262728293031  13
2007
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.c++ Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: Foward referencing broken?         


Author: Gianni Mariani
Date: Mar 31, 2007 23:45

Keith Davies wrote:
> John Watson lectura.cs.arizona.edu> wrote:
>> I can find no error w/ the code below but g++ complains that:
>> 22: error: multiple types in one declaration
>>
>> 22 class Group;
>> 23
>> 24 class Cell{
>> 25 public:
>> 26 uint val;
>> 27 Group *group;
>> 28 Cell();
>> 29 Cell(uint inval, Group *g);
>> 30 };
>> 31
>> 32 class Group{
>> 33 uint val;
>> 34 vector members;
>> 35 public:
>> 36 Group(uint in); //: val(in) {} ...
Show full article (0.99Kb)
no comments
  Re: Foward referencing broken?         


Author: John Watson
Date: Mar 31, 2007 23:39

I edited the class names to be ACell and AGroup just in case they were
clashing with the include files. Again, the error occurs on line 20 w/
G++ spitting: Conc.cpp:20: error: multiple types in one declaration .

01 #include
02 #include
03 #include
04 #include
05 #include
06 #include
07 #include
08 #include
09 #define SHARED...
Show full article (2.59Kb)
no comments
  Re: Stroustrup 5.9, exercise 3         


Author: arnuld
Date: Mar 31, 2007 23:25

> On Mar 31, 11:48 pm, "Alf P. Steinbach" wrote:
> arnuld wrote:
> typedef double ThreeDoubles[3];
> ^^^^^^ ^^^
> t y p e
>
> typedef double ThreeDoubles[3];
> ^^^^^^^^^^^^
> n a m e
> It seems you have assumed a strict order (this first, then that) or
> substitutability (if this name stands for expression x then I can
> replace this name with x), neither of which hold for C and C++ declarations.

i understood "substitutability" is synonym for typedef. i was wrong, i
think C and C++ declarations are much more deeper than that and
Stroustrup did not explain that (but K&R2 does explain that, i checked
that).

anyway, i tried these and they compile with any error:

// to define a type for "pointer to an array of 7 chars"
typedef char *PAchar[7];
Show full article (1.20Kb)
no comments
  Re: Stroustrup 5.9, exercise 4 (page 105)         


Author: arnuld
Date: Mar 31, 2007 22:51

> On Apr 1, 10:01 am, Ian Collins hotmail.com> wrote:
> You can get away without the second temporary (and it might be easier to
> understand):
>
> void swap_p(int* x, int* y)
> {
> int tmp = *x;
>
> *x = *y;
> *y = tmp;
>
> }

that looks good.
no comments
  ===Welcome to comp.lang.c++! Read this first.         


Author: Shiva
Date: Mar 31, 2007 22:29

Welcome to comp.lang.c++! Read this first.

This post is intended to give the new reader an introduction to reading
and posting in this newsgroup. We respectfully request that you read
all the way through this post, as it helps make for a more pleasant
and useful group for everyone.

First of all, please keep in mind that comp.lang.c++ is a group for discussion
of general issues of the C++ programming language, as defined by the ANSI/ISO
language standard. If you have a problem that is specific to a particular system
or compiler, you are much more likely to get complete and accurate answers in a
group that specializes in your platform. A listing of some newsgroups is given
at the end of this post.

The FAQ (Frequently Asked Question) list has a wealth of information for
both the new and veteran C++ programmer. No matter what your experience
level, you are encouraged to read the entire list, if only to familiarize
yourself with what answers are available to minimize redundant replies.
The comp.lang.c++ FAQ is available at http://www.parashift.com/c++-faq-lite/

If the FAQ list does not help, then many regular readers of this group
are happy to assist with problems of standard C++. We have only a few
requests that we ask be adhered to, for the benefit of all:
Show full article (4.79Kb)
no comments
  Re: C++ Contest Challenge         


Author: Onideus Mad Hatter
Date: Mar 31, 2007 22:24

On 31 Mar 2007 19:50:24 -0700, "Siddhartha"
gmail.com> wrote:
>It does to me as well, but you don't have to blurt profanity because
>of it.

What the shit is "profanity"? What are you some fucked up Google
froups (L)user who got lost or something? What did you lose your
Usenet map? Tha fuck...every time a Webbie pisses all over Usenet
with their ban happy, chatty board sense of banal, fuckwitted,
Christian conservative cunt crying, child molesting, Jesus killing
stupidity, GOD RAPES A VIRGIN!

...now get the fuck off Usenet you stupid bitch, before I say
something you'll REALLY regret. `, \

--

Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
http://www.backwater-productions.net/hatter-blog
Show full article (3.25Kb)
no comments
  Re: Temperature Conversion Program - Still a Rookie         


Author: AsheeG87
Date: Mar 31, 2007 22:22

You are a lot of help! And...I feel dumb about some of the mistakes
that I made. I have no clue where I came up with that. But, I'm still
learning. So, here we go. I am having a problem debugging. It won't
execute the program. So, I can build and see the errors that come up
but it won't execute. What am I missing?

Here is my *NEW* code:

// Temperature.cpp : Defines the entry point for the console
application.
//
#include "stdafx.h"
#include
#include
using namespace std;

double FahrenheittoCelsius(double); //Function Prototype
double CelsiustoFahrenheit(double);
Show full article (1.29Kb)
no comments
  Re: Stroustrup 5.9, exercise 4 (page 105)         


Author: Ian Collins
Date: Mar 31, 2007 22:01

arnuld wrote:
>
> void swap_p(int* x, int* y)
> {
> int tmp_x = *x;
> int tmp_y = *y;
>
> *x = tmp_y;
> *y = tmp_x;
> }

You can get away without the second temporary (and it might be easier to
understand):

void swap_p(int* x, int* y)
{
int tmp = *x;

*x = *y;
*y = tmp;
}
Show full article (0.32Kb)
no comments
  Foward referencing broken?         


Author: John Watson
Date: Mar 31, 2007 22:01

I can find no error w/ the code below but g++ complains that:
22: error: multiple types in one declaration
Show full article (0.66Kb)
1 Comment
  Re: Stroustrup 5.9, exercise 4 (page 105)         


Author: arnuld
Date: Mar 31, 2007 21:50

> On Mar 31, 7:28 pm, Manuel T t.gov> wrote:
> Logic errors lie in swap_X functions. Do a little trace on paper and you'll
> discovery why this stuff don't work.

OK, i banged my head with this programme on computer but it did not
make any sense. then as you advised, Manual, i wrote that programme on
paper, as a fresh programme, from scratch and it worked the first time
i typed it into Emacs:

---------- PROGRAMME ----------
#include

void swap_p(int* x, int* y);
void swap_r(int& x, int& y);

int main()
{
using std::cout;
using std::cin;
using std::endl;

int i;
int j;
Show full article (1.50Kb)
no comments
1 2 3 4 5 6 7 8 9