Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
Acmlm's Board - I2 Archive - - Posts by Ramsus
Pages: 1 2 3 4 5 6 7 8 9
User Post
Ramsus

Octoballoon
Level: 19

Posts: 81/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-07-05 09:48 PM, in Laptops Outsell Desktops for First Time! Link
Originally posted by Kitten Yiffer
I actually have surround sound on two computers here. Thought I should upgrade the older computer with some more RAM and a better graphics card and processor.

And yeah, I can understand if Laptops would be good if you're on the move or like to be outdoors alot but I seen too many people who use a laptop on the same desktop all the time.

Thought, I would want one Laptop for the few days where i'm away from home. And we talk about two-three weeks per year or so...


I tried the outdoors thing, but my iBook's screen becomes invisible in sunlight. Sun exposure is generally bad for it too.

Doesn't matter. Pen and paper is better for the eyes and posture anyway.
Ramsus

Octoballoon
Level: 19

Posts: 82/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-08-05 04:00 AM, in Where to start. What to start with. Link
Microsoft has some "Visual Studio 2005 Express" software available for their major languages/platforms: http://lab.msdn.microsoft.com/express/

Go ahead and use them for Windows. After all, it's Microsoft Windows, so why not use Microsoft development tools?

Another free C/C++ IDE (which is just an editor with a compiler and a way to manage your source code) for Windows: http://www.bloodshed.net/devcpp.html

It uses GCC as a compiler, which is open source and is used for almost all Linux, BSD, and Mac OS X programming. Good for writing portable code. Less good for just Windows programming.

Some good notes on C: http://www.cs.cf.ac.uk/Dave/C/CE.html
I've heard people use this site for C++: http://www.cprogramming.com/tutorial.html

Java is a good programming language for a lot of things.
http://java.sun.com/j2se/1.5.0/download.jsp
You can also use Eclipse for an IDE, but it doesn't come with a Java compiler or runtime environment (so you still have to download those from the above link):
http://www.eclipse.org/downloads/index.php

Sun has a nice trail set of tutorials. They're a bit fast, but if you stick to them, you can learn Java rather quickly. If you're already familiar with the concepts, it might only take a few days.
http://java.sun.com/docs/books/tutorial/

EDIT:
C# is Microsoft's answer to Java. These tutorials look interesting:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcoricsharptutorials.asp
http://www.softsteel.co.uk/tutorials/cSharp/contents.html

Perl is a good language if you want to mess with lots of text and data instead of writing games or big desktop applications: http://www.activestate.com/Products/ActivePerl/?_x=1
Tutorials et al: http://www.perlmonks.org/index.pl?node=Tutorials#perlstart
http://www.comp.leeds.ac.uk/Perl/start.html

PHP is good for web development:
http://www.php.net/manual/en/

As for choosing a language, just try out stuff and find something that works. It's a big plus if your compiler or interpreter has good reference documentation though.

If you just like programming for programming's sake and want to get to know computers well, while gaining access to just about everything your OS can do, give C a try. The language is small and well worn, but it allows you to do anything. Then as you need more powerful abstractions to manage bigger projects, you can move into C++, which still lets you access everything C can.

If you want to get started with fancy programs from the get go, go ahead and choose something like VB.Net, C#, Python, or Java. These types of languages also have large libraries you can take advantage of, and the abstractions they provide mean you don't have to understand what's really going on inside the machine. This means you can get started quickly.

---

Other stuff concerning thoughts for my own tutorial site.

---

I find writing programs that aren't interactive to be very interesting, but most beginning programmers these days have probably never seen a console window, let alone a real shell. Since I'm not sure how to approach a tutorial series, I'm sort of brainstorming. Let me know your experiences and ideas.

Since the very concept of what a "program" is isn't the same for most beginners these days as it was ten or twenty years ago, I think it's better for a beginner's tutorial for Windows users to focus on creating an interactive, event-based program instead of a terminal application (I've seen the "what? this is programming?" look too many times). An interactive language with a visual shell has the advantage here too, since the user can get instant results and test parts or their entire program without having to understand terminal interfaces or create new projects.

Windows isn't very UNIXy to begin with.

Then to move from beginner to intermediate, the programmer can plunge into how computers work and learn to write programs in a "pseudo" RISCy assembly language for a simulated system that has a display window (with text and graphics modes), keyboard and mouse input, and access to the filesystem of the OS it runs on.

From there, moving on to C would follow more easily. Even pointers would be an easy concept to understand (just a method for addressing memory). After learning C, the programmer would be introduced to creating and using abstract data types. Finally, he could be encouraged to try using a variety of libraries, frameworks, and APIs to learn various concepts and put them to use.

Then the programmer could be taught a few different paradigms, such as Object-Oriented programming, while learning Java or C++.

Another approach I'm considering is beginning by writing web applications. The user could install Apache and PHP on their computer and learn how to write scripts for it. Then they could be introduced to C from the context of writing CGI applications. From there, they could move into system programming with C.

I'd like to put a lot of thought into this though, which means once it's written, it'll likely be rewritten, over and over, until it's very good. I also want to avoid requiring things that won't be around in ten or twenty years. C looks like it'll live on for a long time, C++ and Java are big right now, and Pascal and Fortran are already dead.


(edited by Ramsus on 06-07-05 11:05 AM)
Ramsus

Octoballoon
Level: 19

Posts: 83/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-08-05 04:20 AM, in Apple to Use Intel Microprocessors Beginning in 2006 Link
Originally posted by Kitten Yiffer
We get to know, sooner or later. If they made a mode there must be a good reason for, whatever it's cost or power...

And hell, what other processors does Intel Produce?


Xscale, which is an ARM derivative. I doubt they'd put it in a desktop machine -- they've done little work on it speed-wise.

I don't have a problem with using Pentium 4's in Macs, since then Apple could more easily expand into the low-end market with high-quality software and well-designed computers. In addition, they could more easily negotiate better graphics cards for their iBooks and PowerBooks with nVidia and ATI.

And the possibilities with x86 virtual machines and compatibility layers like WINE are great.

EDIT: Oh, and Steve Jobs may be more cautious about the whole hardware thing after experiencing fKitten Yiffers in sales with NextStep and the G4 Cube. Moving to a more widespread platform might be an issue of comfort and security than anything else, especially since Intel can guarantee big supplies.


(edited by Ramsus on 06-07-05 11:22 AM)
Ramsus

Octoballoon
Level: 19

Posts: 84/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-08-05 11:32 PM, in Simple C++ Tutorials Question Link
2D games or 3D games?

If you use SDL, you can use this reference documentation with any tutorials:
http://sdldoc.csn.ul.ie/

Lots of good stuff:
http://www.gamedev.net/reference/

Consider reading this:
http://www.gamedev.net/reference/design/features/makegames/default.asp

If you want to use DirectX and DirectDraw, consider learning a little about the Win32 API first:
http://www.winprog.org/tutorial/

DirectDraw kind of disappeared from recent versions of DirectX (I think, I lost track of Windows stuff), but this can still be used with older versions:
http://www.gamedev.net/reference/articles/article608.asp

Now to be perfectly honest, if you understand the stuff at cprogramming.com, you should really be able to jump right in to SDL with nothing more than a basic primer on the structure of a simple 2D game with double buffered graphics.

To get started, just understand that the screen is just a block of memory. Given a pointer to the screen, any way to check the state of input devices and some method to modify memory (memcpy, pointers, arrays), you should be able to write games. Just loop a bunch of times, checking input, updating the math behind the game engine and figuring out what to draw, then drawing.

It's really more complicated, but that's the basic idea.

That means to do game programming, all you need to do is understand:

* variables
* loops
* functions
* pointers
* structures
* reading and writing data from files

Then you just have to understand the idea of code reuse through libraries (aka frameworks and APIs when they get really big), so you know how to use all the features your OS provides for accessing the screen, reading files, and taking input.

You might also have to learn how to convert how data like images and sound are represented in memory (so it matches the screen or audio device), but usually you're provided with functions that can do this for you.

EDIT: And Windows programming might require a bit of knowledge about macros, which are just text-substitution commands for the preprocessor (the program that runs before the compiler looks at the code and gets everything ready to be parsed).

#define X 5
means 5 gets places wherever X is.

#define FUN(a, b, c) (a + b + c)

Replaces FUN(1, 2, 3) with (1 + 2 + 3)

But
#define FUN(a, b, c) a + b + c

Replaces FUN with a + b + c

And that's macros.


(edited by Ramsus on 06-08-05 06:34 AM)
(edited by Ramsus on 06-08-05 06:37 AM)
Ramsus

Octoballoon
Level: 19

Posts: 85/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-09-05 03:06 AM, in Simple C++ Tutorials Question Link
Learning to program just depends on understanding the language and the machine. You'll learn a lot faster by writing lots of programs to test your ideas and understanding. Once you've figured out how to do something, see how other people do it as well.

For an absolute beginner, I've heard stories that span from overnight to months. Go at your own pace; you might surprise yourself.


||bass: Beginners can get started with C in about a third of time time necessary for learning how to use templates and virtual class methods with inheritance to effectively use the object-oriented techniques with C++. While they're working on their small projects and getting to know the machine, they can then learn to use Object Oriented techniques and the OO features of C++ to start working on bigger projects featuring 3D graphics and complex math.

The important thing is that they just get started, and it's hard to write programs from the start when beginning with a relatively large, complex language that has all sorts of abstractions.

Why do very few C++ books start with teaching classes? They essentially teach C at the beginning and move on to classes from there. Think about it.

To put it simply: Beginners don't write "modern" games.

Spending weeks teaching a beginner how to effectively write large, complex programs usually just bleeds away at his initial interest until he gives up.

Not to say all OO languages are big, complicated, and potentially leaky. Java is an example of a much simpler OO language than C++.

And all that habit stuff is nonsense. You can always learn new methods and ways of thinking. Teaching a programmer from the beginning to always keep learning new ideas and methods to improve their programming ability is much more valuable than any single programming paradigm.

EDIT: Argh, Disch beat me to the punch!


(edited by Ramsus on 06-08-05 10:09 AM)
Ramsus

Octoballoon
Level: 19

Posts: 86/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-09-05 05:10 AM, in Looking for a certain tut Link
What texture? It just looks like a bunch of layers screened over a dark aqua background. One with Samus, one with some random text, KAKAROTTO in big letters, a URL, and then a bunch of lines.
Ramsus

Octoballoon
Level: 19

Posts: 87/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-09-05 10:32 AM, in Simple C++ Tutorials Question Link
It's not a question of difficulty, but of size. A person can only take in so much at once.

I don't see the "stop and then change gears" part though. What's the difference? You learn that the c library headers are now cthis or cthat instead of this.h or that.h, structs and enums are essentially typedef'd for you, and the language is more strongly typed (so you have to explicitly cast a few more things here and there).

Other than that, you can pretty much plunge into the C++ way of doing things rather quickly. Use new and delete for memory, references instead of pointers in most cases, objects, and templates to encapsulate functionality instead of static functions, structs, and void pointers. Learn to use standard C++ libraries and STL. Organize class models based on responsibility in order to reduce duplicate code and keep programs manageable, working first with the interface and not caring about the implementation until last.

As an added bonus, you will already have actual programs you've written in C with which you can practice C++ concepts by refactoring them into a more Object-Oriented design, the parts of which you can reuse for even bigger projects.

That teaches even more skills. And at no time after learning C will the programmer be any less or more able to create programs. Instead, they'll be increasing their ability to manage larger and larger amounts of code with abstractions they can appreciate.

And what is my logic? Programmers building themselves up in the same manner that the libraries and languages they use have been built up, so they understand the real value in the abstractions used to build them, in steps that don't hide them from their environment.

C isn't just a subset of C++, but something different that forces you to learn how to do without truly powerful abstractions built into the language, while not hiding the machine from you. C forces you to understand pointers, because you can't do anything without them. It forces you to understand what strings and arrays really are, because it just uses pointers for them.

And then when your programs crash because you accidentally free()'d the wrong pointer, you'll understand the value of references. When you have namespace collisions between functions, you'll understand the value of classes and namespaces. When your code has lots of duplicate parts, you'll understand the value of inheritance and templates. When you get sick of managing memory everywhere and initializing variables to sane values, you'll be glad you have constructors and destructors. And when you're tired of having error handling code all over your program (unless you rigged something with setjmp.h), you'll be glad to discover exceptions.

These are things you can learn while learning the language, but things you learn best through experience trying to write programs.

And when you don't have those abstractions, you'll know how to work without them, even if it means you'll need three tylenol and a glass of water every now and then.

Now tell me how my logic works the other way.

P.S. What abstractions does the 65816 provide that the 6502 doesn't? That metaphor is more like adding some library functions to C and providing better data types, not making it into C++.

EDIT: Looks Disch already mentioned another point I wanted to make in my post.

EDIT 2: I was thinking about it, and I realized why C++ is a relatively complex language, despite having powerful abstractions.

It began when I thought about why C, Java, and Lisp are all relatively simple. Then it hit me; each language is as abstract as the abstractions it provides.

Everything in C is a function operating on data, almost how the machine operates. Likewise, everything in Java is an object, and everything in Lisp is a list. Java and Lisp don't need things like memory management, because they don't make sense at their respective levels of abstraction. The way each language works is designed around the abstraction it provides.

So how is C++ different?

It's as abstract as C, so you can do low-level things. At the same time, it provides features for building higher level abstractions like generic programming and objects.

So you can have your cake and eat it.

The cost is that it takes longer to learn, because you have to essentially learn how to think at all of the different levels (and thus, types) of abstraction the language lets you use. That means a bigger learning curve for the beginner.

I think it's well worth it though, so while I'd suggest C for beginners (especially those who want results), the motivated and talented beginner who enjoys programming for programming's sake should consider ignoring me and jumping straight into C++.


(edited by Ramsus on 06-08-05 05:44 PM)
(edited by Ramsus on 06-08-05 05:46 PM)
(edited by Ramsus on 06-08-05 06:57 PM)
Ramsus

Octoballoon
Level: 19

Posts: 88/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-10-05 06:51 PM, in Problem with HTML + CSS -> Printing Link
I think IE strips backgrounds from printed pages by default. Check the Internet Options and set it to print the background as well. That might fix it, but it might not.

I'm on a Mac, so I can't find it myself, but it looks just fine printed from Safari.
Ramsus

Octoballoon
Level: 19

Posts: 89/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-12-05 04:34 AM, in Looking for a certain tut Link
So basically you mean this:


The PSD file

The PSD file

The PSD file


If you do, then you're really new to this, aren't you?

It's basic Photoshop stuff. Just paste an image as a new layer, add a layer mask, pull out the gradient tool, set the tool options to multiply, and apply some gradients to the layer mask so it blends nicely. The layer mask is just a grayscale layer that corresponds with a layer, where the blacker each pixel is on the layer mask, the more transparent the pixel is in the layer.

If you want the image to pick up its color from the layers beneath it, set the blending mode of the layer to Value.

If you want to apply a solid color over the entire image, create a new layer on top of everything, fill it with a single color, and set its layer blending mode to Color.

Now mess around with the other blending modes so you have an idea of how they work. Screen and Multiply are the most important, with Value and Color being second.

So aside from all the little pixel lines drawn all over the image you mentioned, it's really quite simple. From what I see, he didn't even use any filters. Even the text just has a gradient over it (probably done with blending options, but maybe he rasterized the layer and added the gradient manually).

In other words, understand blending modes, layer masks, and blending options, and you'll be able to do all sorts of stuff.

I wouldn't really suggest mixing colors (like below), unless you have a clear idea of what you're trying to go for. When different colors blend into each other, they can get muddy.


The PSD File

You can also get a lot of other effects with blending modes:


The PSD File

Try using Overlay with gradients to highlight certain features of an image. This is especially useful for bringing out a person's face, so attention is immediately drawn to it. Just create a white blob with the radial gradient, white inside, black outside, and set it to overlay over the person's face. A lot of portrait painters use this technique for the same reason, albeit with different means.

Compare:




These are just some friends of mine. The first picture uses the technique, the second is the original picture. Notice the difference? The trick is to keep it subtle.


(edited by Ramsus on 06-11-05 11:36 AM)
(edited by Ramsus on 06-11-05 11:58 AM)
(edited by Ramsus on 06-11-05 12:16 PM)
(edited by Ramsus on 06-11-05 12:19 PM)
(edited by Ramsus on 06-11-05 12:26 PM)
Ramsus

Octoballoon
Level: 19

Posts: 90/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-12-05 05:32 AM, in 10 years since PHP 1.0 was released! Link
It just goes to show how long it takes for software to completely mature, since the language was still seriously lacking in a lot of ways (namely its mediocre support for OO) until PHP5 came out.

I still consider PHP3 to be the first real version of the language.

Ramsus

Octoballoon
Level: 19

Posts: 91/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-13-05 01:04 AM, in OOP Link
Effective OO design does require certain features built into the language, otherwise it becomes nothing more than another way to organize functions and data. If you want to learn OO programming, take a week or two and learnJava.

From there, look into design patterns and commonality and variability analysis.

Oh, and Disch, how's about we not call Lisp a functional programming language while we're at it? After all, you can use functional programming techniques in C and assembly, albeit much less effectively.

But then again, Lisp is really powerful as a functional programming language because the functions are a type of data (originally they were lists), so you can write macros that generate more code. The language is designed around the "paradigm" itself, which is why we call it functional.

Try implementing OO design patterns in C and assembly, but it'll be ugly as hell. In fact, it'd be easier (and more efficient, since at least a C++ compiler usually knows how to optimize OO code because the features are built in) to just code things in a structured manner.

That's why we don't consider C an Object Oriented language.

Or do you just consider Object Oriented Programming to be nothing more than another way of functions acting on data? If so, you have the same short-sighted view that so many early C++ texts had on it.
Ramsus

Octoballoon
Level: 19

Posts: 92/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-13-05 01:45 AM, in Help with some N64 code Link

lui $a1,801C
addiu $a1,$a1,8D75 ;Get joypad status



(edited by Ramsus on 06-12-05 08:47 AM)
Ramsus

Octoballoon
Level: 19

Posts: 93/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-13-05 02:06 AM, in OOP Link
Right, so it doesn't matter that you're doing twice as much typing to use a paradigm that your language doesn't provide abstractions for.

And by ugly, I mean more difficult to manage and change and longer to type. Can you honestly say that using OO techniques in C, you can reduce code duplication as much as you can in C++?

Besides, you never touched Object Oriented design patterns, merely how to implement a simple inheritance model in C. I've seen that a million times with projects like GTK+.

When you start getting into the really abstract stuff, you'll end up with a lot more code than you need. That's what I consider ugly.
Ramsus

Octoballoon
Level: 19

Posts: 94/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-13-05 04:03 AM, in OOP Link
I guess we have different ideas of how descriptions like "Object-Oriented" and "Procedural" apply to languages. I don't see them as limiting in describing the language and what it can't do, but merely making it clear what types of methods and abstractions the language is designed around (as well as how most programmers choose to use that language, which is important in team development).

So that's where we really disagree.

Although I will admit, I don't like using Object-Oriented design in C, since I do think there are usually better ways of using the flexibility C provides to write shorter, cleaner code.

And I would consider C++ more multi-paradigm than anything. It's a procedural, object-oriented, semi-functional language with generics. In this case, I can see where you're coming from. My idea of an Object Oriented language is something more like Smalltalk or Java anyway.

Basically, when using OO design starts providing a significant gain in code reusability and design over other paradigms, while allowing you to make use of OO design patterns, without having strange quirks or requiring lots of unnecessary code, I consider the language in use an OO language.
Ramsus

Octoballoon
Level: 19

Posts: 95/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-13-05 04:24 AM, in Help with some N64 code Link
I thought the same thing, but the description of lui I found says it zeros the bottom half.
Ramsus

Octoballoon
Level: 19

Posts: 96/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-13-05 04:54 AM, in Help with some N64 code Link
Now this makes me want to try some ROM hacking.

And did you update the language address part too? That's about all I can suggest right now, since I don't know jack about N64 hardware or Zelda OoT.


(edited by Ramsus on 06-12-05 11:56 AM)
Ramsus

Octoballoon
Level: 19

Posts: 97/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-13-05 11:33 AM, in Help with some N64 code Link
How is the joypad status byte laid out? The L or R bug sounds kind of strange.

And are you sure the language byte is used during the game? Maybe it's checked at the beginning and used to set a function pointer somewhere.

Also, I'm only studying PowerPC and MMIX assembly, but try this:

lui $s2,801C
lbu $s3,8D75($s2) ;Get joypad status
addiu $s2,$zero,0030 ;Value for L+R
bne $s3,$s2,.end ;No
nop
lui $s2,8011
lb $s3,C089($s2) ;Language addr
addiu $s3,$s3,0001 ;Next
andi $s3,$s3,0001 ;But don't go past 1
sb $s3,C089($s2) ;Store it

.end:
[original op: addiu $s3,$zero,0004]
j 0A2EBC
[original op: or $s2,$zero,$zero]


EDIT:

I switched lb to lbu so it wouldn't set the upper 24 bits (or 56 bits if the registers are 64-bit) to whatever the sign bit of the loaded byte was. I think that might have been related to the L+R bug, but 0x30 in binary wouldn't have the sign bit anyway, so I doubt it. Let me know if it works, and if not, add the and instruction back in.



(edited by Ramsus on 06-12-05 06:41 PM)
(edited by Ramsus on 06-12-05 06:42 PM)
(edited by Ramsus on 06-12-05 06:51 PM)
Ramsus

Octoballoon
Level: 19

Posts: 98/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-14-05 06:55 AM, in Help with some N64 code Link
They probably had something rigged for the translation team so they could switch between languages while testing the game. Say there's something missing in English, they could switch it to Japanese.

I don't even know what the size of the instructions are, so follow what the programmers did with the game.

Are there any good debugging tools for N64 emulators? That's about all I can think of trying at this point.
Ramsus

Octoballoon
Level: 19

Posts: 99/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-14-05 11:25 PM, in An Issue With Converting Code From C to C++ Link
sloat: What the hell? The original code is just fine. You just made it longer, and I don't think you realize how it's being used. Also, what's the point of creating a pointer to the address of the first element of an array? THAT'S WHAT AN ARRAY IS.

To the original post:

It should be perfectly valid C++, and it does work perfectly with GCC 4. The typedef shouldn't make a difference either, since that just creates a new name for the same type (as opposed to a different type).

My only suggestion, aside from removing the unnecessary typedef, is to remove the [9] and replace it with []:


MAPSCREEN_POINTER_LOCS pointer_tables[] = {


What compiler are you using?



(edited by Ramsus on 06-14-05 02:28 PM)
(edited by Ramsus on 06-14-05 02:28 PM)
(edited by Ramsus on 06-14-05 02:29 PM)
Ramsus

Octoballoon
Level: 19

Posts: 100/162
EXP: 34651
For next: 1126

Since: 01-24-05
From: United States

Since last post: 39 days
Last activity: 71 days
Posted on 06-15-05 02:46 AM, in An Issue With Converting Code From C to C++ Link
Originally posted by sloat
Originally posted by Ramsus
sloat: What the hell?



Hello to you too. Nice to meet you.


The original code is just fine. You just made it longer, and I don't think you realize how it's being used.



I just figured that since he had errors compiling it, he might want to try a different way.

And it is longer. Good observation.


Also, what's the point of creating a pointer to the address of the first element of an array?



I was just demonstrating that you can have a pointer type of the struct with the struct's definition and how it could potentially be used. It didn't have to be the first element, but 0 was what I chose.


THAT'S WHAT AN ARRAY IS.



What's the point in getting mad about it?
If it bothers you that much, I'll remove the code from my old post. No skin off my sac.

Thanks for the input.


Sorry for offending, but your code doesn't really take on the problem of initializing the array of structs to begin with. It merely provides another method of accessing the members.

Pages: 1 2 3 4 5 6 7 8 9
Acmlm's Board - I2 Archive - - Posts by Ramsus


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.013 seconds.