473,836 Members | 2,292 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Structs in Java

Hi,

We all know that Java has classes but how about basic storage objects like
structs? C and C++ have Structs, Pascal has Records, Visual Basic has Types
etc. How about Java?

Greetings,
Rick
Nov 13 '05
18 30274
Damn it, the only thing I read on this newsgroup is
"this is off-topic"
"post it somewhere else"
"you're stupid"
"I'm a better programmer than you"

Yeah yeah, I know there's lots of posting here and if everyone just postes
what he wants it gets a huge mess. True! But come on, it's as if everyone
first reads the messages to detect some word to bitch on. If it depends on
some of you I can post my stuff nowhere because none of the 10 million
newsgroups is exactly suitable. Stop that, don't be such nerds and stop
saying to others that they are stupid because they missed one pointer or
whatever. Helping each other is ment to be fun, but on this particular
newsgroup most of the C gurus here seem to be grumphy all day?! If you don't
really like to help, than don't.

I posted that on the 'obsolete' java newsgroup indeed. So what? Noone cares
there, I got helped, we had a little discussion about structs and shit and
it was fun. Next time I help one of them. I use lot's of newsgroups and of
course I just don't post anything but this is ridiculous. I've always been
helped friendly everywhere except here. In almost every post someone is
bitching (and not only my own posts). And then it get's repeated 100 times.
Well wiseguys, that's even more off-topic in my eyes. Their are nicer ways
to tell someone is wrong. Here I often get the feeling that the elite C
gurus are laughing at the rookies and are trying to 'bully' them away with
silent hints. Come on man, help the poor guys. Here I'm a total newbie in C
comparing to most others. But on some other newsgroup I obviously know more
than the average user. Instead of calling them stupid I always love to help
them, no matter what their question is, damn it's almost as in doctor Phill.
So what if it's a little bit off-topic? The world is larger then C right?

Ok, I said my word. Nevertheless, I appreciete all the help. And by the way,
I'm not picking specificly on you Joona, it's just my overall impression
about this newsgroup. Let's say a friendlier athmosphere would be good for
this group. Make love, not war.

Have a nice day,
Rick

Nov 13 '05 #11
Rick <as******@hotma il.com> scribbled the following:
Damn it, the only thing I read on this newsgroup is
"this is off-topic"
We say this.
"post it somewhere else"
And we say this.
"you're stupid"
But we don't say this.
"I'm a better programmer than you"
And we don't say this either.
Yeah yeah, I know there's lots of posting here and if everyone just postes
what he wants it gets a huge mess. True! But come on, it's as if everyone
first reads the messages to detect some word to bitch on. If it depends on
some of you I can post my stuff nowhere because none of the 10 million
newsgroups is exactly suitable. Stop that, don't be such nerds and stop
saying to others that they are stupid because they missed one pointer or
whatever. Helping each other is ment to be fun, but on this particular
newsgroup most of the C gurus here seem to be grumphy all day?! If you don't
really like to help, than don't.


You seem to be in need of a sever attitude readjustement. We don't
think we're better programmers, or better people, because we only
discuss standard C. It's simply what this newsgroup is all about.
Do you yourself think comp.lang.c is for discussing Java? Which part
of "comp.lang. c" mentions Java anywhere?
If you still think we said we're better programmers than you, or that
you are stupid, please point out the exact place we've said that.

(Rest snipped)

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"This is a personnel commuter."
- Train driver in Scientific American
Nov 13 '05 #12
Hi,

Well, the examples are not directly said. I'm not a genious reader but just
from reading lot's of messages here I notice it. I never noticed it in
another
newsgroup before so I'm not talking crazy crap. Of course they don't say it
directly
like "case: I am > you;" and I'm not saying you're doing that as well. But
there certainly are some examples. I'm not going to copy paste or throw
names but
here's a simulation:

"Hi, my name is Timmy, I'm 7 years old and I'm new to C. I need to program
a rocket defense system. It's almost done but now I'm stuck with <blabla>
here's a code snippet : ...>"
Most answers are seriously trying to help the poor kid but often I also see
reactions like these :
"It's really obvious, what do you think?!"
// Damn, if I knew it I wouldn't post it wiseguy!
"Sigh, here we go again, post it at rocket.lang.c"
// I really readed that 'sigh' stuff before (not your reaction)! Don't
do that!
"That's what seperates the REAL programmers from the amateurs..."
// Yeah yeah, so you must be mister Miyagi at C? (context reading)
"Using function xyz is not too smart!" and then it get repeated 10 times
// ok, thanks for pointing but I knew it after this is already the sixth
time somebody said it

There's nothing wrong with the sentences on it self but among with the
context
I detect some...cockynes s(shit, I don't know the right englisch words :[,
englisch is not
my native language (neither is C)). As I said, there are nicer ways to help.

Another example, when I posted my first thing I was using C for 2 weeks. So,
no wonder
that I have some dumb questions then, pointers and stuff are not easy if
you're
used to do Delphi or something! Anyway, I placed a simple question and then
I get
a dozen of answers. Most of them are good but there are also a few people
who had
to add that I should know this and are explaining the problem in Techno
Language.
Then there's also some wiseguy who tries to prove I didn't copy paste my
code
snippet from the internet. Who cares?! Does it really matter if it's copy
pasted
or not? I typed it over so there was a tiny error inside. That's no big deal
but
the guy keeps pooping ( "did not!", "did too!" etc. etc. "STOP!" ).

Hey, and here some copy pastes! :
"A random Google sample shows him to be a thoughtless, boorish troll,
who
attempts to elevate repetition into a virtue, and who clearly doesn't
understand C. Sorry, but I don't share your apparent "admiration " for
this
character."
// don't know exactly where it's all about, maybe the guy is right but
man, please let the
// "and who clearly doesn't understand C" away

Here's something about the repeating, a 'newbie' asked something and get's
as a first (friendly) answer he'd be better off in another newsgroup. But
then some other dude feels he just had to post it again, right after the
previous answer.
"again, as you were told, you will have much better help in a
MS Windows newsgroup or a newsgroup about your compiler."
// And this was the only stuff in the post so it didn't add much. If you
care about heavy
// internet traffic then messages like this shouldn't be placed again
and again.

Or take a look at the "ANSI C compliance" post. It was a bit off topic so
here we go again, a dozen of 'angry' men picking at each other. Really cozy
newsgroup this is.

Some of you are reading the posts too precisely. If there's a wrong
character
because I spelled my name wrong or the post isn't 100% alt.lang.c, 1 or 2
guys
are feeling they need to start about it. And not one post, nononoo, it often
get's repeated as if the other guy has a IQ of <32. Enough examples, and
maybe
I'm a little bit whining myself but the point is, posting something here is
not
fun, especially when you are a newbie. I sure can take critic, I'm happy if
somebody
is trying to help me out. But here you'll have to watch on every digit you
type!
One wrong thing and there's an army of nerds yelling! How the heck was I
supposed
to know that xyz<>abc! On other newsgroups I can post 'whatever' I want and
they keep friendly. And if it's a little bit off-topic, no problemo, a
little variation can be fun as well.

Of course I know there are boundaries, I won't post pictures of my naked but
and grandpa's stories
about WO1 here but please don't pick out every wrong detail or 'misplaced'
post. It's ruining
the mood in my opinion. Maybe I'm spoiled and I shouldn't complain but I
just have seen much
nicer newsgroups than this one. Too bad, because I know there are talented C
people hanging
around here. I hope it's a little bit clear now.

Greetings,
Rick

Nov 13 '05 #13
"Rick" <as******@hotma il.com> writes:
[...]
Another example, when I posted my first thing I was using C for 2
weeks. So, no wonder that I have some dumb questions then, pointers
and stuff are not easy if you're used to do Delphi or something!
Anyway, I placed a simple question and then I get a dozen of
answers. Most of them are good but there are also a few people who had
to add that I should know this and are explaining the problem in
Techno Language. Then there's also some wiseguy who tries to prove I
didn't copy paste my code snippet from the internet. Who cares?! Does
it really matter if it's copy pasted or not? I typed it over so there
was a tiny error inside. That's no big deal but the guy keeps pooping
( "did not!", "did too!" etc. etc. "STOP!" ).


At least some of the repetition is caused by the fact that this is an
asynchronous medium. It takes time for articles to propagate.
Someone asks a question with a more or less obvious answer. Multiple
people reply before seeing that everyone else is doing it. (And I,
for one, have a big enough ego that I'm not always willing to sit back
and wait for someone else's answer, especially if I think I have some
insight that someone else might miss.)

Another factor is a general unwillingless to let misinformation,
deliberate or otherwise, go unanswered.

As for the copy-and-paste issue, a lot of the questions asked here are
about subtle errors in source code. We take a look at the posted code
and find errors in it; how are we supposed to know whether those
errors are in your original code or were introduced when you re-typed
it?

For example, if you post something like

if (x = 0) {
printf("x is zero\n");
}

and ask why x is never zero, I'll tell you that it's because you used
"=" instead of "==". If you reply that of course you had "==" in your
original program, you just mis-typed it, I'll remind you to
cut-and-paste the exact code next time so we can tell you what the
real problem is.

Cut-and-paste is easier than re-typing anyway.

The dynamics of this newsgroup are such that it's easy to keep a
discussion going, but very difficult to stop one. There are oodles of
regular readers, and dozens who post regularly. Stopping a discussion
requires all of them to agree to stop posting about it. It does
happen sometimes, but probably not as often as it should. Threaded
newsreaders help.

Rick, I'm not saying you don't have some valid points, I'm just trying
to help you understand why things are the way they are.

--
Keith Thompson (The_Other_Keit h) ks*@cts.com <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
Nov 13 '05 #14

"Rick" <as******@hotma il.com> wrote in message
news:3f******** *************** @news.xs4all.nl ...
Hi,

We all know that Java has classes but how about basic storage objects like
structs? C and C++ have Structs, Pascal has Records, Visual Basic has Types etc. How about Java?


You can have methodless (except for the constructor) classes. There is a
difference, though, between Java and C++ in this case. If you reference a
class from inside another class you get Object reference variables:

class Point {
int x,y;
}

class Line {
Point one, two;
}
A C struct, or, as I understand, C++ class, will allocate memory for two
Point's in a line. Java will allocate two Point reference variables. The
Point objects will have to be created separately.

-- glen
Nov 13 '05 #15
I feel much better already :) Let's contineu C.

Greetings,
Rick
Nov 13 '05 #16
Rick wrote:
Sorry, posted in the wrong newsgroup per accident! Should be in the Java.


Once you realize your mistake, you can cancel a post, you know...

Nov 13 '05 #17
Nudge <de*****@kma.eu .org> writes:
Rick wrote:
Sorry, posted in the wrong newsgroup per accident! Should be in the Java.


Once you realize your mistake, you can cancel a post, you know...


You can try. Many servers don't recognize cancels.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
(Note new e-mail address)
Nov 13 '05 #18
"Keith Thompson" <ks***@mib.or g> wrote in message
news:ks******** ****@nuthaus.mi b.org...
Nudge <de*****@kma.eu .org> writes:
Rick wrote:
Sorry, posted in the wrong newsgroup per accident! Should be in the
Java.
Once you realize your mistake, you can cancel a post, you know...


You can try. Many servers don't recognize cancels.

Do you mean that some *do* ?
Nov 13 '05 #19

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

Similar topics

8
25921
by: Rick | last post by:
Hi, We all know that Java has classes but how about basic storage objects like structs? C and C++ have Structs, Pascal has Records, Visual Basic has Types etc. How about Java? Greetings, Rick
5
2073
by: Grant Austin | last post by:
What would be the correct syntax for setting up a dynamic array of structs? Suppose you have a struct declared: struct relation { FILE * binFile; unsigned int numAttrs; struct attrList * relAttrs; /* definition shown at end of post */ };
10
1996
by: Patricia Van Hise | last post by:
Is it possible to access a field of a struct which is a field of another struct? Ex. struct subStr{ int num1; int num2; }; struct myStr { int num3; subStr *lock; };
289
1805
by: napi | last post by:
I think you would agree with me that a C compiler that directly produces Java Byte Code to be run on any JVM is something that is missing to software programmers so far. With such a tool one could stay with C and still be able to produce Java byte code for platform independent apps. Also, old programs (with some tweaking) could be re-compiled and ported to the JVM. We have been developing such a tool over the last 2 years and currently...
19
1642
by: Xandau | last post by:
hello all, i wotk with java every day but last time i have interested in C#. everything goes great except one thing... in java everything is a reference (except plain types) so i thought that in C# will be the same - i was wrong.... or if in C# is the same as in java please tell me ;-) I have an ArrayList names ls : // Point is a class System.Draw....
61
3789
by: Marty | last post by:
I am new to C# and to structs so this could be easy or just not possible. I have a struct defined called Branch If I use Branch myBranch = new Branch(i); // everything works If I use Branch (myBranch + x) = new Branch(i); // it doesn't x is a loop iterator, i is an int for the constructor to define an array. What am I doing wrong here.
19
2563
by: desktop | last post by:
There is a lot of info on this topic on google. But in Bjarne Stroustrup 's book page 225 he writes: "The declaration of Date in the previous subsection (declared as a struct) provides a set of functions for manipulating a Date. However, it does not specify that those functions should be the only ones to depend directly on Date ’s representation and the only ones to directly access objects of class Date . This restriction can be...
4
7977
by: Jazi | last post by:
Hello All, I have a function in C++ that takes an array of struct. I want to convert this function to java using SWIG. Here what I have structs.h typedef struct myStruct{ char name;
29
2360
by: s0suk3 | last post by:
Hello, I was hoping to get some opinions on a subject. I've been programming Python for almost two years now. Recently I learned Perl, but frankly I'm not very comfortable with it. Now I want to move on two either Java or C++, but I'm not sure which. Which one do you think is a softer transition for a Python programmer? Which one do you think will educate me the best?
0
9810
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9656
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
10821
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
10527
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...
0
10241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7773
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6973
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();...
1
4441
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
3102
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.