Please register to participate in our discussions with 2 million other members - it's free and quick! Some forums can only be seen by registered members. After you create your account, you'll be able to customize options and access all our 15,000 new posts/day with fewer ads.
I thought that could have been a possibility as well. But the usage of "Select" in this case is odd, so I wasn't sure.
So I made the assumption that "Select" meant "set" and wrote it out in C:
int * Pointer;
*Pointer = 1; Kaboom. Where is *Pointer?
while (*Pointer < 10) Not needed, will never test true as *Pointer>5 will end loop first{
Pointer = *Pointer; //This line is obviously wrong. Indeed this is wrong. Will get a compile error in a strong type check compiler (such as C++). If it compiled and linked, the next line will kaboom
*Pointer++;
if (*Pointer > 5)
break;
}
Either I'm misinterpreting something, or the psuedocode has an error in it.
NJBest, I understand all you did was translate the original stuff to a reasonable language people can understand. I didn't make an attempt to follow the original stuff at all. So my comments are directed to the original post, it was just easier to follow your translation.
mjohnson, if NJBest did capture your intent properly, there are some basic things you are not understanding. One is the role of a pointer and the other is loop control.
Either I'm misinterpreting something, or the psuedocode has an error in it.
I don't know what language the OP is using either. Even though I don't code anymore I'm fairly sure the code posted by the OP is basically *all* error.
I disagree. C is *not* a language that people unerstand. It's a language that is full of much less than intuitive constructs. The average person would call it gibberish.
There are other languages that people actually can understand without having years of programming knowledge under their belt. Also, those languages can be more easily understood by code analyzers making advanced development tools easier to produce.
Code completion tools which can cut coding time down significantly are much easier to produce in better languages. Also, two way coding via visual design is easier to provide in stricter languages.
I disagree. C is *not* a language that people unerstand. It's a language that is full of much less than intuitive constructs. The average person would call it gibberish.
There are other languages that people actually can understand without having years of programming knowledge under their belt. Also, those languages can be more easily understood by code analyzers making advanced development tools easier to produce.
Code completion tools which can cut coding time down significantly are much easier to produce in better languages. Also, two way coding via visual design is easier to provide in stricter languages.
And I disagree with you. C/C++ is one of the most reasonable languages to use when trying to discuss algorithms and/or concepts. The reason for this is because the majority of computer scientists know this language. Java and C++ are the most common languages used at universities for data structures and advanced programming. Java uses the C syntax.
This thread is not for the "average person". It's clearly targeted towards computer scientists or knowledgeable programmers.
Anyways, this argument is not in line with the OPs question.
The reason for this is because the majority of computer scientists know this language.
Java and C++ are the most common languages used at universities for data structures and advanced programming.
This thread is not for the "average person".
Anyways, this argument is not in line with the OPs question.
I said C is not a good language because it is terse and obscure. I'm not commenting on its "commonality". I said the average person would call it gibberish to support my statement.
Universities make money by selling classes. They will choose the language which leads to more class hours.
Right, the thread is not for the average person. That is why I stated that C is not a good language. The average person will not have a clue as to way it is or isn't a good language.
You're right this has gone off topic. But, it is the beginning of a great topic to discuss.
Almost, but not quite accurate. You should clear it up so it's not confusing to the OP.
that is my understanding of what a pointer is; i use python so i don't have much experience with them, it just looked like his question wasn't being addressed. feel free to clear up anything you thought was inaccurate.
No offense to the OP, but you really should spend a little more time searching for the information. You can find thousands of examples on the concept of pointers doing a simple Google.
Please register to post and access all features of our very popular forum. It is free and quick. Over $68,000 in prizes has already been given out to active posters on our forum. Additional giveaways are planned.
Detailed information about all U.S. cities, counties, and zip codes on our site: City-data.com.