|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
On April 12 2011 20:26 Kambing wrote:Show nested quote +On April 12 2011 20:06 chaokel wrote: Hi wondering if anyone can help me with an error i'm getting in my c code for an uni assignment.
Error: Unresolved external 'input()' referenced from L:\ICT102\ASSIGNMENTQUESTIO N2A.OBJ Error: Unresolved external 'calculate()' referenced from L:\ICT102\ASSIGNMENTQUE STION2A.OBJ
I believe its got something to do with using call to references to return data from these modules but i cant figure out what its telling me is wrong.
I assume input() and calculate() are functions that you wrote? If so, it sounds like that you reference them in assignmentquestion2a.c via forward declarations (e.g., from a .h file) but then don't include the .c files that provide their implementation. That fix in that case is to compile the .c files that contain the definitions of input() and calculate() at the same time you compile assignmentquestion2a.c. Alternatively, if input() and calculate() are being provided to you as a library, you haven't included those libraries in your compilation step.
Thats whats confusing me, I have defined those functions within the file i'm trying to compile. assignmentquestion2.cpp .
The other functions that i've defined in there that don't call to reference aren't erroring which is why i think it has something to do with that. i.e. void input(int &input, int &denomination1, int &denomination2, int &denomination3, int &denomination4) is erroring but void display(int total1, int total2, int total3, int total4, int denomination1, int denomination2, int denomination3, int denomination4) is not.
any other thoughts would be greatly appreciated.
|
Hello! Im seraching for a thread: It was this riddle thread - programming related, a number of tasks following each other which quickly became harder and harder. Some of the first ones were solved by modifying the link, then harder and more extrem tasks, sending to other sites.
I cant find it and i desperatly need it, i'm sure a programmer would know what im talking about, as i remember it being quit a big deal
|
I use Visual Studio for C#, DrRacket for PLT Racket, and emacs for everything else.
I'd be interested in people's Javascript/HTML development environments. Is there anything that beats emacs/vim for client-side web programming?
|
Hyrule18968 Posts
On April 13 2011 01:40 Geo.Rion wrote: Hello! Im seraching for a thread: It was this riddle thread - programming related, a number of tasks following each other which quickly became harder and harder. Some of the first ones were solved by modifying the link, then harder and more extrem tasks, sending to other sites.
I cant find it and i desperatly need it, i'm sure a programmer would know what im talking about, as i remember it being quit a big deal notpr0n?
|
On April 13 2011 01:40 Geo.Rion wrote: Hello! Im seraching for a thread: It was this riddle thread - programming related, a number of tasks following each other which quickly became harder and harder. Some of the first ones were solved by modifying the link, then harder and more extrem tasks, sending to other sites.
I cant find it and i desperatly need it, i'm sure a programmer would know what im talking about, as i remember it being quit a big deal
http://www.deathball.net/notpron/
is this the one you mean?
|
On April 13 2011 02:05 chaokel wrote:Show nested quote +On April 13 2011 01:40 Geo.Rion wrote: Hello! Im seraching for a thread: It was this riddle thread - programming related, a number of tasks following each other which quickly became harder and harder. Some of the first ones were solved by modifying the link, then harder and more extrem tasks, sending to other sites.
I cant find it and i desperatly need it, i'm sure a programmer would know what im talking about, as i remember it being quit a big deal http://www.deathball.net/notpron/is this the one you mean?
that's not really programming riddles, but yeah, that's where you want to look I think.
|
You can find very interesting programming puzzles at Project Euler. I've done a few dozen over the past few months and they're a lot of fun.
|
On April 12 2011 20:40 chaokel wrote: Thats whats confusing me, I have defined those functions within the file i'm trying to compile. assignmentquestion2.cpp .
The other functions that i've defined in there that don't call to reference aren't erroring which is why i think it has something to do with that. i.e. void input(int &input, int &denomination1, int &denomination2, int &denomination3, int &denomination4) is erroring but void display(int total1, int total2, int total3, int total4, int denomination1, int denomination2, int denomination3, int denomination4) is not.
any other thoughts would be greatly appreciated. Do you have multiple source files? Are we talking C (which is what you said) or C++ (which is what those & implies)?
Make sure that if you have a prototype for input, it matches the signature of its definition.
|
On April 12 2011 20:40 chaokel wrote:Show nested quote +On April 12 2011 20:26 Kambing wrote:On April 12 2011 20:06 chaokel wrote: Hi wondering if anyone can help me with an error i'm getting in my c code for an uni assignment.
Error: Unresolved external 'input()' referenced from L:\ICT102\ASSIGNMENTQUESTIO N2A.OBJ Error: Unresolved external 'calculate()' referenced from L:\ICT102\ASSIGNMENTQUE STION2A.OBJ
I believe its got something to do with using call to references to return data from these modules but i cant figure out what its telling me is wrong.
I assume input() and calculate() are functions that you wrote? If so, it sounds like that you reference them in assignmentquestion2a.c via forward declarations (e.g., from a .h file) but then don't include the .c files that provide their implementation. That fix in that case is to compile the .c files that contain the definitions of input() and calculate() at the same time you compile assignmentquestion2a.c. Alternatively, if input() and calculate() are being provided to you as a library, you haven't included those libraries in your compilation step. Thats whats confusing me, I have defined those functions within the file i'm trying to compile. assignmentquestion2.cpp . The other functions that i've defined in there that don't call to reference aren't erroring which is why i think it has something to do with that. i.e. void input(int &input, int &denomination1, int &denomination2, int &denomination3, int &denomination4) is erroring but void display(int total1, int total2, int total3, int total4, int denomination1, int denomination2, int denomination3, int denomination4) is not. any other thoughts would be greatly appreciated.
When you use "int &input, int &denomination" are you trying to pass a pointers to ints? if thats the case the syntax is "int *" rather than "int &".
In fact now that I think of it I'm not really even sure what "int & name" implies in a function definition as & is used to make a pointer from your variable which I don't believe is a valid operation in a function signature...
|
vvvvvvvvv that noticeable,,,,,,,,,,,,
|
On April 13 2011 03:34 dogmeatstew wrote:Show nested quote +On April 12 2011 20:40 chaokel wrote:On April 12 2011 20:26 Kambing wrote:On April 12 2011 20:06 chaokel wrote: Hi wondering if anyone can help me with an error i'm getting in my c code for an uni assignment.
Error: Unresolved external 'input()' referenced from L:\ICT102\ASSIGNMENTQUESTIO N2A.OBJ Error: Unresolved external 'calculate()' referenced from L:\ICT102\ASSIGNMENTQUE STION2A.OBJ
I believe its got something to do with using call to references to return data from these modules but i cant figure out what its telling me is wrong.
I assume input() and calculate() are functions that you wrote? If so, it sounds like that you reference them in assignmentquestion2a.c via forward declarations (e.g., from a .h file) but then don't include the .c files that provide their implementation. That fix in that case is to compile the .c files that contain the definitions of input() and calculate() at the same time you compile assignmentquestion2a.c. Alternatively, if input() and calculate() are being provided to you as a library, you haven't included those libraries in your compilation step. Thats whats confusing me, I have defined those functions within the file i'm trying to compile. assignmentquestion2.cpp . The other functions that i've defined in there that don't call to reference aren't erroring which is why i think it has something to do with that. i.e. void input(int &input, int &denomination1, int &denomination2, int &denomination3, int &denomination4) is erroring but void display(int total1, int total2, int total3, int total4, int denomination1, int denomination2, int denomination3, int denomination4) is not. any other thoughts would be greatly appreciated. When you use "int &input, int &denomination" are you trying to pass a pointers to ints? if thats the case the syntax is "int *" rather than "int &". In fact now that I think of it I'm not really even sure what "int & name" implies in a function definition as & is used to make a pointer from your variable which I don't believe is a valid operation in a function signature...
In C++, T& is type "reference to T" which is not present in C. A reference to T is an alias for an object. Practically speaking, it is a pointer to an object that you treat as if it was the actual object (e.g., so that you use dot notation to access it's fields rather than the -> syntactic sugar).
|
On April 13 2011 03:50 Kambing wrote:Show nested quote +On April 13 2011 03:34 dogmeatstew wrote:On April 12 2011 20:40 chaokel wrote:On April 12 2011 20:26 Kambing wrote:On April 12 2011 20:06 chaokel wrote: Hi wondering if anyone can help me with an error i'm getting in my c code for an uni assignment.
Error: Unresolved external 'input()' referenced from L:\ICT102\ASSIGNMENTQUESTIO N2A.OBJ Error: Unresolved external 'calculate()' referenced from L:\ICT102\ASSIGNMENTQUE STION2A.OBJ
I believe its got something to do with using call to references to return data from these modules but i cant figure out what its telling me is wrong.
I assume input() and calculate() are functions that you wrote? If so, it sounds like that you reference them in assignmentquestion2a.c via forward declarations (e.g., from a .h file) but then don't include the .c files that provide their implementation. That fix in that case is to compile the .c files that contain the definitions of input() and calculate() at the same time you compile assignmentquestion2a.c. Alternatively, if input() and calculate() are being provided to you as a library, you haven't included those libraries in your compilation step. Thats whats confusing me, I have defined those functions within the file i'm trying to compile. assignmentquestion2.cpp . The other functions that i've defined in there that don't call to reference aren't erroring which is why i think it has something to do with that. i.e. void input(int &input, int &denomination1, int &denomination2, int &denomination3, int &denomination4) is erroring but void display(int total1, int total2, int total3, int total4, int denomination1, int denomination2, int denomination3, int denomination4) is not. any other thoughts would be greatly appreciated. When you use "int &input, int &denomination" are you trying to pass a pointers to ints? if thats the case the syntax is "int *" rather than "int &". In fact now that I think of it I'm not really even sure what "int & name" implies in a function definition as & is used to make a pointer from your variable which I don't believe is a valid operation in a function signature... In C++, T& is type "reference to T" which is not present in C. A reference to T is an alias for an object. Practically speaking, it is a pointer to an object that you treat as if it was the actual object (e.g., so that you use dot notation to access it's fields rather than the -> syntactic sugar). So its a self dereferencing pointer. That sounds pretty useless but okay I accept that its valid syntax.
|
On April 13 2011 04:21 dogmeatstew wrote:Show nested quote +On April 13 2011 03:50 Kambing wrote:On April 13 2011 03:34 dogmeatstew wrote:On April 12 2011 20:40 chaokel wrote:On April 12 2011 20:26 Kambing wrote:On April 12 2011 20:06 chaokel wrote: Hi wondering if anyone can help me with an error i'm getting in my c code for an uni assignment.
Error: Unresolved external 'input()' referenced from L:\ICT102\ASSIGNMENTQUESTIO N2A.OBJ Error: Unresolved external 'calculate()' referenced from L:\ICT102\ASSIGNMENTQUE STION2A.OBJ
I believe its got something to do with using call to references to return data from these modules but i cant figure out what its telling me is wrong.
I assume input() and calculate() are functions that you wrote? If so, it sounds like that you reference them in assignmentquestion2a.c via forward declarations (e.g., from a .h file) but then don't include the .c files that provide their implementation. That fix in that case is to compile the .c files that contain the definitions of input() and calculate() at the same time you compile assignmentquestion2a.c. Alternatively, if input() and calculate() are being provided to you as a library, you haven't included those libraries in your compilation step. Thats whats confusing me, I have defined those functions within the file i'm trying to compile. assignmentquestion2.cpp . The other functions that i've defined in there that don't call to reference aren't erroring which is why i think it has something to do with that. i.e. void input(int &input, int &denomination1, int &denomination2, int &denomination3, int &denomination4) is erroring but void display(int total1, int total2, int total3, int total4, int denomination1, int denomination2, int denomination3, int denomination4) is not. any other thoughts would be greatly appreciated. When you use "int &input, int &denomination" are you trying to pass a pointers to ints? if thats the case the syntax is "int *" rather than "int &". In fact now that I think of it I'm not really even sure what "int & name" implies in a function definition as & is used to make a pointer from your variable which I don't believe is a valid operation in a function signature... In C++, T& is type "reference to T" which is not present in C. A reference to T is an alias for an object. Practically speaking, it is a pointer to an object that you treat as if it was the actual object (e.g., so that you use dot notation to access it's fields rather than the -> syntactic sugar). So its a self dereferencing pointer. That sounds pretty useless but okay I accept that its valid syntax.
To the contrary, references are a cornerstone of hygienic C++ programming. The critical thing is that references are not re-seatable. That is, given
int &x = ...;
There is no way to change what x refers to. Most of the time, you do not need your pointers to be reseated, so references give you exactly the functionality you need and no more which is (almost) always a good thing.
|
I really don't see different programming languages being a huge barrier to having a unified programming thread. Obviously I see where discussing syntax specifics could be a bit difficult. However the logic behind the program and its functionality can, and should be universally applicable.
Personally I would be interested in network programming as well as multi threading. In java/c#/python ObjC or C++
|
[begin language lawyer post]
On April 13 2011 04:21 dogmeatstew wrote: So its a self dereferencing pointer. That sounds pretty useless but okay I accept that its valid syntax.
There are a few reasons that it can be useful, and a couple reasons that it is nearly critical when you talk about interacting with other C++ features.
In particular, using const references (e.g. int const & x or const int & x; these are the same) as function parameters is extremely common to avoid copying. If you were to use pass-by-pointer, then what amounts to a micro-optimization changes the syntax at the call sites: you have to do foo(&y) instead of foo(y), while if you have references, the latter works with both foo(int x) and foo(int const & x). In these cases, having references allows you to be oblivious as to whether foo uses this optimization or not, and provides what can be a substantial syntactic convenience in the implementation of foo itself.
Where this becomes essential is operator overloading. It allows you to define a class, say a vector, that allows you to do v1 + v2, and make your overloaded + operator take const references as an optimization. If you were forced to pass by pointers, then the call becomes &v1 + &v2, which means something entirely different.
Using non-const references (aside from some cases where you return a reference) is more controversial. For instance, you could use one as an 'out' parameter in a function, which is another place you see pass-by-pointer in C. For cases where the out parameter is mandatory I like it, because it's self-documenting and (mostly) self-enforcing that the parameter cannot be null (you have to do reasonably ugly hackery to get a null reference, and even creating one is undefined behavior); the downside is that if you use pass-by-pointer for out parameters than it becomes self-documenting at the call sites, because you'll see foo(&the_out_parameter). So some style guides stipulate that pass-by-const-reference is fine, but pass-by-non-const-reference isn't and you should use pass-by-pointer instead. (And this is another reason using references instead of pointers is helpful: if you follow the above convention, and see [i]foo(&p)[i], you know that foo may change p, because if it were taking a pointer just as an optimization, it would have taken a reference instead.)
IMO the importance of the inability to reseat a reference is well behind the non-nullability of references which is well behind the pass-by-const-reference benefits.
|
9 Posts
Hey im a High School Student that gets good grades and wants to get into writing code. I was wondering however what would be a good starting language for me to learn and teach myself until I could get a class for coding.
Also if you responded to my first question I also ask what would be a good software to download to help write the code (ie Netbeans) or any other tips you may have.
Thanks
|
It doesn't matter what you are starting with as most programmers will tell you. The trade of programming is the act of programming itself not how to learn syntax of a language.
It is however very beneficial to learn a language that is widely used as you will find more resources on it.
It really depends on what you want to accomplish and some people starting out will want to write applications you know the windows, the buttons etc... so C# and .NET is great, for tools, either grab the free Visual C# express or sign up with dream spark and get free Visual Studio.
|
On April 14 2011 07:48 a7d9sdkk6k3kja9sd0d0 wrote: Hey im a High School Student that gets good grades and wants to get into writing code. I was wondering however what would be a good starting language for me to learn and teach myself until I could get a class for coding.
Also if you responded to my first question I also ask what would be a good software to download to help write the code (ie Netbeans) or any other tips you may have.
Thanks
Python is a pretty good beginner language and is very close to pseudocode so you can focus on the algorithms instead of language quirks, you can get more info at http://diveintopython.org/toc/index.html.
I'd recommend not using an IDE at start as they do a lot of the basic stuff for you but since you are trying to learn it would probably be best if you at least start by doing everything by hand so that you can understand what you are actually doing and not pasting stuff together. You only need a text editor to edit source code, I'd recommend notepad++ or emacs (notepad++ is much easier to use , emacs has a steep learning curve but is VERY powerful)
|
On April 14 2011 07:48 a7d9sdkk6k3kja9sd0d0 wrote: Hey im a High School Student that gets good grades and wants to get into writing code. I was wondering however what would be a good starting language for me to learn and teach myself until I could get a class for coding.
Also if you responded to my first question I also ask what would be a good software to download to help write the code (ie Netbeans) or any other tips you may have.
Thanks
I recommend starting with an object-oriented programming language such as Java. In terms of software - you really just need a source code editor and compiler to start with. A simple one that I used during college for my Java classes is called jGrasp and is completely free.
Also, it isn't that important which specific language you start off with. I don't have any experience with Python yet, though it has been getting popular recently and is a little simpler than other languages.
|
I have to admit, I don't get folks who recommend newbies start off with Java, C++, or C#. There's no way that someone with no prior programming experience would be able to quickly understand all the boilerplate and abstraction going on here. In addition, it's hard to write Java or C# without a big elaborate IDE, and a newbie needs to become comfortable with a text editor first, or else he might never. Python seems reasonable. C also seems reasonable. HTML and Javascript, I think, is reasonable.
|
|
|
|