Trying to decide which programming language I want to learn

Click For Summary
Choosing a programming language to learn can be challenging, especially for someone with a background in older languages like assembly, Fortran, and Pascal. C# and C++ are considered for firmware design, while Python is favored for its ease of use and relevance to gaming, particularly with grandchildren. C++ is noted for its speed and compactness, making it suitable for game programming, but it may require more effort to learn compared to C#. Resources like Visual Studio for C# and various online tutorials can help beginners get started, while microcontroller programming can be explored through platforms like Arduino and Raspberry Pi. Ultimately, the choice should align with personal interests in scientific or gaming applications.
  • #391
sysprog said:
The compiler would reject the 0++ incrementation directive inside the brackets of the a[0++] expression because 0 is not a variable.
I'll take your word for it but, as long as the context is only iteration and not re-iteration (ie: it doesn't need to be rezeroed), it saves a superflous explicit declaration.
 
Technology news on Phys.org
  • #392
hmmm27 said:
I'll take your word for it but, as long as the context is only iteration and not re-iteration (ie: it doesn't need to be rezeroed), it saves a superflous explicit declaration.
What's wrong with a[1]?
 
  • #393
Mark44 said:
C++:
unsigned i = 0;
while (i < dynArr.size())
{         
      num = dynArr[i++];
      cout << num << " ";// display all the numbers until the end.         
}
This is of course also a common application for a traditional for-loop:
C++:
for (int i = 0; i < dynArr.size(); i++)
{
    cout << dynArr[i] << " ";
}
Or in a modern (post 2011) version of C++, a range-based for-loop:
C++:
for (int num : dynArr)
{
    cout << num << " ";
}
 
  • Like
Likes pbuk
  • #394
pbuk said:
What's wrong with a[1]?
Nothing, if your purpose is to explicitly access the second element in an array. In what context were you comparing it to a hypothetical a[0++] statement ?
 
  • #395
pbuk said:
What's wrong with a[1]?
hmmm27 said:
Nothing, if your purpose is to explicitly access the second element in an array. In what context were you comparing it to a hypothetical a[0++] statement ?
I believe pbuk was referring to this post of yours, #380:
hmmm27 said:
wouldn't be surprised if a c compiler accepted, and processed properly, something to the effect of a[0++]
There's nothing hypothetical about a[0++]. It just flat won't compile.
 
  • #396
This thread is getting very long, with just under 400 posts. @yungman, when you have another question, please start a new thread.
 
  • Like
Likes pbuk
  • #397
Thank guys, my big boss just had a hip replacement yesterday and she's home. I am too busy right now to read the replies right now. I'll get to it later tonight or tomorrow.

thanks
 
  • #398
I'm closing this thread now. If anyone other than the OP (@yungman) feels the need to reply to a post here, please let me know, and I'll reopen it temporarily.
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 107 ·
4
Replies
107
Views
9K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
16
Views
3K
  • · Replies 54 ·
2
Replies
54
Views
5K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 58 ·
2
Replies
58
Views
4K