Edit: Why does Java use the term 'method', while C++ says function? They look similar to me. lol
The Big Programming Thread - Page 212
Forum Index > General Forum |
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. | ||
Shield
Bulgaria4824 Posts
Edit: Why does Java use the term 'method', while C++ says function? They look similar to me. lol | ||
phar
United States1080 Posts
In C++ I think technically you call methods "member functions" or some shit. It's just an OO term: http://en.wikipedia.org/wiki/Method_(computer_science) | ||
Bigpet
Germany533 Posts
On December 08 2012 12:51 darkness wrote: I've just checked C++'s syntax, and it looks very similar to Java's imho. I'm glad I will have an easier time to learn this language. ^^ Edit: Why does Java use the term 'method', while C++ says function? They look similar to me. lol Syntactically Java borrows heavily from C++. Multiple reasons for the name Method. Methods always belong to a class and using the term Method also doesn't clash with the mathematical definition of a function (not really that big of a reason, since basic aspects like the = symbol are still semantically very different from maths). Basically C++ got all the terminology from C and Java borrowed some from other languages like Smalltalk.
| ||
fabiano
Brazil4644 Posts
![]() | ||
waxypants
United States479 Posts
On December 06 2012 04:06 Recognizable wrote: I had to search for what scope is but I guess I understand it a bit better now. Why is this important? Why doesn't the computer understand what you are doing when you aren't indenting? def f(a,b): Am I right in saying that this works because return is in the same scope as C,D and so it can do something with these variables. If return wasn't indented it wouldn't be able to do that because it wasn't in the same scope and therefore can't do anything with those variables? ambiguity | ||
akarin
Ireland42 Posts
| ||
Deleted User 101379
4849 Posts
On December 08 2012 21:46 akarin wrote: okeydoke Write code to print the word “racecar” to the VDU twice. Print the word once using the INC instruction to read ASCII values from memory, once using the DEC instruction. You may use loops, but only if you wish. It is possible to write a solution without loops and you will not be docked marks for not doing so Use the DB directive to store one value in memory per letter, so seven in total. Using one register as a pointer to memory, read each stored value one by one into another register, then into an area in memory starting at [C0]. You MUST use indirect addressing. You should increment your pointer register using the INC instruction. Once all letters have been printed to the VDU, print them again using the DEC command to decrement your pointer register. So effectively you will be printing out the word backwards. In total you will print 14 letters, so your program will be quite long! As the word is a palindrome, your final output should read racecarracecar This is not a "We do your homework for you" thread. How does your current code look and what part do you have problems with? | ||
3FFA
United States3931 Posts
As for the reason I'm learning C and not C++ is because that is the language my school is teaching me. When I originally signed up for this class(which is brand new here) it was indeed going to be learning how to use C++ but then they changed the language to C due to not being able to do something a certain way that they wanted to with C++. | ||
Tobberoth
Sweden6375 Posts
On December 10 2012 02:29 3FFA wrote: Thanks everyone on the previous page for your help! As for the reason I'm learning C and not C++ is because that is the language my school is teaching me. When I originally signed up for this class(which is brand new here) it was indeed going to be learning how to use C++ but then they changed the language to C due to not being able to do something a certain way that they wanted to with C++. I wonder what their reasoning was, since C++ is a superset of C, you can do everything in C++ that you can do in C. | ||
Kambing
United States1176 Posts
On December 10 2012 02:40 Tobberoth wrote: I wonder what their reasoning was, since C++ is a superset of C, you can do everything in C++ that you can do in C. If they aren't exploring object-oriented programming, then C is the right choice. You don't want to teach students C-style programming in (un-idiomatic) C++. | ||
windzor
Denmark1013 Posts
On December 10 2012 02:43 Kambing wrote: If they aren't exploring object-oriented programming, then C is the right choice. You don't want to teach students C-style programming in (un-idiomatic) C++. And depending on the field, you wont be doing C++ programming but C as some of the C++ constructs can impose performance issues in embedded environments. | ||
Tobberoth
Sweden6375 Posts
| ||
3FFA
United States3931 Posts
edit: it may be the embedded environments portion. | ||
Craton
United States17250 Posts
iPhone supports Objective C, C, C++ and seems to support other languages now in some fashion WP7 supports C# w/ Silverlight, though there seems to be roundabout ways to use other languages WP8 supports at least C and C++ Source: Google | ||
![]()
white_horse
1019 Posts
| ||
shem
United States7 Posts
| ||
Craton
United States17250 Posts
This seems to be a popular question on Google, btw. You could just ask your professor for clarification. | ||
magicmUnky
Australia280 Posts
C is fine for learning the basics of control using really basic controllers (PIC, Arduino, MSP430 etc) but the moment you want to do anything interesting or use over 100Mhz, you'll be likely working with a toolset written with C++ rather than C; and you'll need those extras available in C++ to write effective programs. For example.. if you want to do any industrial automation or dynamic control, you'll be using something like an Arm Cortex M3, minimum... maybe a TI Concierto (it's a CM3 with a DSP on the side, sharing the same clock http://www.ti.com/mcu/docs/mcuproductcontentnp.tsp?sectionId=95&familyId=2049&tabId=2743 )... any of that stuff will use C++ Many of the cheap and easy to work with processors over 600Mhz are programmed using .NET (they're tailored for communication). | ||
Marradron
Netherlands1586 Posts
On December 10 2012 08:34 white_horse wrote: How do you "scale" an array so that its maximum value is 1? Our professor wants us to do that to the array "body" (below) but I have no idea what that means. This is for MATLAB not c++,
A = 2 3 5 7 >> A=A./max(A(: )) A = 0.2857 0.4286 0.7143 1.0000 Bassically you scale the array by the maximum value in the array. One problem is that the array in your code is defined as an array with only zeroes. For that case it is not clear what the professor wants. | ||
![]()
Poopi
France12886 Posts
So I just finished a project (well there is this problem so it's not literally finished) in PHP with some mySQL. However I had a problem with a basic search bar. It won't matter since I already sent my project, with the problem, because of the deadline, but my curiosity wants to know what was the solution for this problem. I could not really find the right key words on google so here I ask you if you can help me. So I want the request to search in a precised table the word typed, but I want it to only show the results from this table associated with the current userid. Here is my request showing it but for every id : SELECT * FROM products WHERE name LIKE '%$search%' ORDER BY name (not sure about the syntax Im on mobile don't have access to the files). I would like something like that instead : SELECT * FROM products WHERE fournid='$fournid' AND name LIKE etc $search the $_post of the searchbar and $fournid the $_cookie['userid'] of the current user. Problem this request won't work and I know it but I don't know how I'm supposed to do it. Any ideas? Thanks in advance. | ||
| ||