|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Is char [5:0] abc
different from char abc [5:0] ? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 2007-12-29 13:12, call_me_anything wrote:
> Is char [5:0] abc > > different from > > char abc [5:0] ? Yes, but non of it is C++. -- Erik Wikström |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
This is like saying that a Ph.D. student cannot solve a high school
problem. Come on dude! You can tell the answer if you know it. I am sure many C++ programmers also wouldn't be knowing the difference either. And if it makes you happy, here is another version of the same problem : Class foo; Is foo [5:0] abc; different from foo abc [5:0]; On Dec 29, 5:44 pm, Erik Wikström <Erik-wikst...@telia.com> wrote: > On 2007-12-29 13:12, call_me_anything wrote: > > > Is char [5:0] abc > > > different from > > > char abc [5:0] ? > > Yes, but non of it is C++. > > -- > Erik Wikström |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Sun, 30 Dec 2007 01:03:06 -0800, call_me_anything wrote:
> > On Dec 29, 5:44 pm, Erik Wikström <Erik-wikst...@telia.com> wrote: >> On 2007-12-29 13:12, call_me_anything wrote: >> >> > Is char [5:0] abc >> >> > different from >> >> > char abc [5:0] ? >> >> Yes, but non of it is C++. >> > This is like saying that a Ph.D. student cannot solve a high school > problem. Come on dude! You can tell the answer if you know it. He did tell you the answer: it's not C++. > I am sure many C++ > programmers also wouldn't be knowing the difference either. > > And if it makes you happy, here is another version of the same problem : > > Class foo; > Is foo [5:0] abc; > different from > foo abc [5:0]; Still not C++. Have you tried compiling any of this with a standard C++ compiler? -- Lionel B |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
call_me_anything wrote:
> Come on dude! You can tell the answer if you know it. > I am sure many C++ programmers also wouldn't be knowing the difference > either. Why should they? I am sure that many of them (like me) don't even know what language your code is supposed to be. It's not C++, so a C++ programmer doesn't need to know. > And if it makes you happy, here is another version of the same > problem : > > Class foo; > Is foo [5:0] abc; > different from > foo abc [5:0]; Yes, the problem is still the same: It's not C++ code. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
call_me_anything wrote:
Top posting is very confusing to me, so I moved what you wrote. > On Dec 29, 5:44 pm, Erik Wikström <Erik-wikst...@telia.com> wrote: >> On 2007-12-29 13:12, call_me_anything wrote: >> >>> Is char [5:0] abc >>> different from >>> char abc [5:0] ? >> Yes, but non of it is C++. >> >> -- >> Erik Wikström > > This is like saying that a Ph.D. student cannot solve a high school > problem. I completely fail to understand that. In what way does the answer you received even imply that? > Come on dude! You can tell the answer if you know it. > I am sure many C++ programmers also wouldn't be knowing the difference > either. I suppose that I am one of the C++ programmers who don't recognize what you posted as being C++ code. Is this some sort of trick question? > > And if it makes you happy, here is another version of the same > problem : > > Class foo; 'Class foo;' is not valid C++. Did you mean 'class foo;'? Although, of course, class Class {}; Class foo; is valid, but using 'Class' as a class name would probably not be a good idea. However if, class foo; foo abc; then foo is an imcomplete type and so this will not compile. > Is foo [5:0] abc; > different from > foo abc [5:0]; AFAIK, '[5:0]' is not part of C++. Or at least its a part of C++ I am unfamiliar with. However, on the theory (something for which the evidence is well established) that I am often wrong or ignorant, I tried two variants of your code at http://www.comeaucomputing.com/tryitout/ First, class foo {}; foo [5:0] abc; and then, class foo {}; foo abc [5:0]; Both of these failed to compile. So, I conclude that Mr. Wikstrom's answer was correct. I also tried class foo {}; foo abc; And that compiled. I feel certain, or at least, I suspect, that if you will explain the question that you want answered, you will get better information. As it is, I'm not quite sure what question you want answered. Might I recommend that you post the shortest compilable version of the code that you wish to ask about. http://www.parashift.com/c++-faq-lit...t.html#faq-5.8 LR |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
On Dec 29, 5:44 pm, Erik Wikström <Erik-wikst...@telia.com> wrote:
> On 2007-12-29 13:12, call_me_anything wrote: > > > Is char [5:0] abc > > > different from > > > char abc [5:0] ? > > Yes, but non of it is C++. > > -- > Erik Wikström "call_me_anything" <sgiitnewid@gmail.com> wrote in message news:0b6aa8bc-8ed6-4d7d-bcc2-b17f47dadd80@i12g2000prf.googlegroups.com... >This is like saying that a Ph.D. student cannot solve a high school >problem. >Come on dude! You can tell the answer if you know it. >I am sure many C++ programmers also wouldn't be knowing the difference >either. >And if it makes you happy, here is another version of the same >problem : >Class foo; >Is foo [5:0] abc; >different from >foo abc [5:0]; The statement "A Ph.D. student cannot solve a high school problem" is almost certainly true. Or in other words, the chances of there existing a Ph.D. student s and a high school problem p such that Can'tSolve(s, p) is true [where the semantics of Can'tSolve(s, p) are such that s can't solve p in real life] are extremely high. As it happens, I'm a Ph.D. student, and there are lots of high school problems in subjects I didn't take that I can't solve (and a fair few in subjects I did take, especially ones I've forgotten). Why would you expect that for all students s and high school problems p, CanSolve(s, p)? In fact, I very much doubt if there exists a student s such that, for all high school problems p, CanSolve(s, p)... Anyway, in answer to question, the only plausible answer is "Maybe. Define the semantics of 'different' in the language in which you're writing." People in this newsgroup understand the semantics of things in C++, but what you've written is in a language which no-one here recognises, so you need to tell us what you mean before we can answer your question. (Incidentally, since your code isn't in C++, it's off-topic, but that's another matter.) To clarify this point, consider two possibilities for the above: 1) In your language, two snippets like the above are 'different' iff they differ textually. In that case, the answer to your question is indubitably 'yes'. 2) In your language, two snippets like the above are 'different' if the characters of either snippet are not a permutation of those of the other. In that case, the answer to your question is 'no', since either snippet in the above could be transformed into the other by permuting its characters. HTH, Stu P.S. I strongly suspect you're a troll. Stop it :-) |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
<snip>
> 2) In your language, two snippets like the above are 'different' if the ....'different' iff... (Sorry) > characters of either snippet are not a permutation of those of the other. > In that case, the answer to your question is 'no', since either snippet in > the above could be transformed into the other by permuting its characters. > > HTH, > Stu <snip> |
|
![]() |
| Outils de la discussion | |
|
|