Earlier quoted context omitted.
Why is putting char* into a union a bad idea?
char* points to some mutable buffer of char's that is supposed to be allocated somewhere. In this particular case they are assigned string literals, but in general it would be quite easy for someone to break consistency of allocations/deallocations in such code.
Resume in C
51–60 of 115 posts
Re: Resume in C
#52Re: Resume in C
#53It's cheeky, but then again it is a project you can show someone. Graphic designers get to make fancy schmancy resumes to impress their potential employers, so why not programmer? Better make sure there are no bugs in it though.
Ah nothing like handing your resume over to a prospective employer and having it SEGFAULT
Re: Resume in C
#54Earlier quoted context omitted.
what does that even mean? Isn't C99 an extension of C90/ANSI? Doesn't GCC support the whole of C99 as an extension to ANSI?
It means that GCC will allow/support this even if you set it to std=c89 or std=c90.
Re: Resume in C
#55Re: Resume in C
#56Earlier quoted context omitted.
It's subjective. It feels more c like and natural to me to write while (foo->bar) and not while (foo[i].bar). The latter feels like the way you would do it somewhere else, grafted onto C. But it's not wrong, I don't have deep qualms with it, and that's why I put it last on my list.
It's not subjective. Intel's guidelines for writing vectorizable code: Prefer array notation to the use of pointers. C programs in particular impose very few restrictions on the use of pointers; aliased pointers may lead to unexpected dependencies. Without help, the compiler often cannot tell whether it is safe to vectorize code containing pointers. Source: https://software.intel.com/sites/default/files/8c/a9/Compile…
Array access is more specific and intentional than pointer arithmetic.
Re: Resume in C
#57For bonus points (or not, depending on the recipient's sense of humour) construct a resume that would be suitable for the underhanded C contest ( http://www.underhanded-c.org/ ).
Re: Resume in C
#58Earlier quoted context omitted.
It's supported by GCC as an extension to C90 too.
what does that even mean? Isn't C99 an extension of C90/ANSI? Doesn't GCC support the whole of C99 as an extension to ANSI?
For instance, implicit function declarations are allowed in C90 but not in C99.
Re: Resume in C
#59Code review: * The struct members and variables pointing at string literals should be const. * People do break this all the time but typedefs ending in _t are reserved by POSIX. * Your C99 style struct initializers are valid but it's notable that one popular compiler, MSVC, will not like them. * If we are being idiomatic I would suggest pointer arithmetic to iterate instead of using a counter i.
* Avoid using NULL in your resume. It has a negative connotation, and makes your resume look bad.
* Make use of as many existing libraries as possible, to show that you're not the kind of programmer that wants to invent the wheel on every occasion.
* Try to obfuscate your resume a little (but not too much!) As it is written here, your reader can easily guess what the program will do, and he/she will not even want to run it anymore.
* #include a portfolio of your work inside your resume.