Anyone know the rationale for using typedef for structs when a struct is itself a typedef? I have seen this in just about every book I have ever read, never with any explanation, yet I know from extensive personal experience that the end result is exactly the same (at least on all compilers from the last 10 years). Is it nothing more than an effort to save typing 'struct' on the variable declarations (and that not even needed in C++)? For instance, this all seems to be the same:
Code:
typedef struct {
int i;
} bob;
struct nob {
int i;
};
bob b;
struct nob n;
I have heard people adamantly argue that everything should be typdef-ed as a way to make maintenance easier, but in my experience when you change a data type you still need to examine every single place it is used in the entire code base to make sure you aren't creating bugs with the type change, so I don't see the maintenance benefit. I find it a lot more useful to know what an object type is without needing to constantly look up what the heck the typedef really is (of course, for structs that doesn't help). Good IDEs will make that process less painful, but I have found my ability to maintain code is actually decreased with the extensive use of typedefs.
So, any arguments for the use of typedefs?
Edit MySQL Row Using PHP and HTML Form
Hello,Here's what I'm trying to do. Build a page where a user enters a MySQL row number in. Then, a new page appears with an HTML form where the user can edit the information in that row. Like for
filesize problem
i use ubuntu 9.10 and i have mountet a folder from an windows/mount/FOLDER/mount/FOLDER/FILE.txti try to find out the size of folder : FILE.txtPHP Warning: filesize(): stat failed for
How do I give a developer access to a specific directory and nothing else?
I want to give a develop access to a specific directory and nothing elseI can give them an FTP account with access to a sub directory, but this doesn't exactly solve the problem!1. They can write PHP
Array to string conversion
Can anyone help me with this?Notice: Array to string conversion in /home/..../index.php on line 360Whatever this is, it's causing the script to fail at uploading.Code (starting just before line
WORDPRESS - Multiple Loops Only Going to One Post?
I have various pages with multiple loops and i need them to be individual to all other categories.2 columns.Left column shows 4 posts from category news just with the date and some custom
TemplatePower & AJAX
Hi all,I'm currently implementing some AJAX features in my PHP-framework (which is based on TemplatePower) and I have encountered a problem:I have a block which holds a message-div. This block is
how do i make a string??
hey guys,can someone please tell me how to put data from the glob function into a stringthanks
Open link with largest int string first
I have the following links i would like to open either all at once or one-by-one. How would i proceed? <a href="/spo/1437571200.html"
How to schedule the a job?
Hi,
Simple Variable Question
Hi everyone.... again,I am really getting into php still. Learning more every day. I love it.But I have run into a problem I cannot solve.From what I understand, you can only "echo