Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Cayo Perico Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

      1. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

      1. GTANet 20th Anniversary
    2. Support

    3. Suggestions

Random Programming Questions


Liamardo

Recommended Posts

The problem with game developers (having been one myself) is that they use MS Visual Studio. Often not by choice, because you pretty much have to for XBox development, and supporting multiple dialects at once is problematic. Unfortunately, C++ features are added to MSVS sluggishly. It's better than it used to be, but MSVS 2015 still doesn't support about half of the C++14 features. Although, to their credit, they have dropped support for trigraphs as far back as 2013, and that's a C++17 feature. (This was sarcasm, by the way.)

 

Worse yet, because games take a while to develop, and Microsoft is very bad at backwards compatibility, game developers very frequently aren't using the latest version of Visual Studio. Last studio I've worked at only switched to MSVS 2012 last year, and they were basically forced into that version by XBOne development. Up to that point, studio was using 2010, which has actual compiler bugs that aren't being fixed by MS because the version is no longer supported. So they had to switch from one outdated version to another, encountering new unsupported compiler bugs along the way, some of which I had to fix personally.

 

So the problem really isn't with the language so much as with the tools available to game developers for that language. That's not to say that C++ is perfect. But right now, I work at a company that's all C++14 under clang. Between new language features, clang's helpful error messages, and tools like clang-format, it's a completely different work process. I hope, game developers working exclusively on PS4 titles are making the best of this as well.

Link to post
Share on other sites
  • 1 year later...

I have a question about a PHP:

 

In a combo box connected with MYSQL, I use a while to pick the data from a column, but I wonder how much data can pick the "while"? If I have a table with +100 data, the while will pick all the data and print on the combo box or pick less?

 

Sorry for my english...

Link to post
Share on other sites

Depending on exact implementation of the SQL DB, there can be a limit to how many rows you can fetch with a single SELECT statement. As far as I know, MySQL will let you iterate through as many as the DB will provide, memory limitations notwithstanding.

 

With big data sets, it is sometimes desirable to set a limit to how many rows you fetch.

 

SELECT * FROM table_name LIMIT 1000;
will return the first 1000 rows. You can combine it with WHERE and some index to break up data into pages. This is often done to reduce memory requirements and to otherwise improve performance.

 

However, 100+ rows are usually no problem to get in one query. You only really start having to think about it at 1000+ mark.

Link to post
Share on other sites
  • 2 months later...

Are you trying to parse something from xml or json and fire off a notification? Or is Parse some android package that has passed me by since it's been years since I've written for android.

Link to post
Share on other sites
  • 2 years later...
10 minutes ago, NileshKumar said:

Which is better: Codeblocks or Borland?

 

For C++

Borland%20CPP%205.02.png

Just because you want to code in an old language doesn't mean you need to use an old IDE.

Admittedly, I don't work with C++, but you won't go wrong with VS Code or maybe CLion (<3 JetBrains). I've used Codeblocks in uni (it's what a teacher suggested), was not a great experienced, very quickly switched to Visual Studio.

Link to post
Share on other sites

Actually I am gonna learn (and master) C,Java,Python and C++ all in the next 4 years in my college.

 

They only teach C and Java, for the others I am on my own, I recently started C++.

Edited by NileshKumar
spelling
Link to post
Share on other sites

Visual Studio would be my go-to for C++. I'd also drop Java entirely if you can, it's objectively awful.

  • Like 2
Link to post
Share on other sites
On 11/29/2020 at 8:50 PM, NileshKumar said:

I am only interested in Python and C++, which the colleges here don't teach. They are stuck on primitive languages like C and Java.

If you think you're going to learn C++ without learning C, you'll be better off learning JavaScript. You aren't going to get a C++ job if you don't know C.

 

f*ck Java with a rusty pipe, though. That's not worth anything anymore, unless you have a deep masochistic desire to work on Android Java code.

 

Oh, and to get you started, you don't even need a compiler.

https://wandbox.org/ - for actually running your code.

https://godbolt.org/ - for code analysis and disassembly.

 

But to get a job, companies will expect you to know how to use VisualStudio C++ from both the GUI and command line as well as GCC or CLang from command line. All three are free and available for your choice of operating system in one form or another. Companies/projects that don't rely on VisualStudio will also usually use something like make or cmake for managing large projects, and you'll be expected to know at least the basics of these as well. Also take a look at Bazel if you'll be working on anything Google-related, but you can get to that later.

 

The reason I recommend to get a bit of a feel for writing code with online compiler is because the way you structure input to the compiler has a bit to do with how you write code in C/C++, so it's easier to understand how to build a project and compile code once you understand a little bit about how to write it.

  • Like 1
Link to post
Share on other sites

While Java 8 is not too fun an experience, if you want to do Android stuff, you'll choose Kotlin. But Java knowledge is useful for Kotlin, too, so you know how some of the Kotlin black magic (syntactic sugar) works.

 

I wouldn't call it a primitive language, though.

Link to post
Share on other sites
7 hours ago, Edmachine said:

I wouldn't call it a primitive language, though.

Antiquated is a better term for Java. By the time Google bought Android, it was already an outdated piece of tech solving problems that didn't exist in modern world. The fact that Google stuck with it instead of burning it all down is the most evident proof that the company was already run by "effective managers", rather than engineers, at that point, long before Alphabet happened.

 

If you actually want to embrace all the things Java is claiming as its objectives, you ought to be compiling Rust code to LLVM. That solves the same problems much more efficiently, at compile time, and giving you full native performance on output. Moreover, none of the lifetime errors will show up in the runtime, because they will be resolved at compile time. As a result, garbage collection and memory leaks just aren't a thing.

 

But even that's overkill, which is why pretty much everything except Android has abandoned Java and is sticking to C-derivatives. A compiler handles all platform variations far, far better than JVM ever could with no penalty to performance, and while garbage collector is an excellent safeguard in most cases, in practice, it leads to overwhelming majority of Java developers not understanding the difference between strong and weak references, and end up writing code that leaks memory. You're better off with "unsafe" memory model of C/C++ and good development practices than a garbage collector you don't understand. And this is particularly true of modern C++, where simply slapping hands of your junior developers, metaphorically speaking, any time they use a raw pointer, is generally adequate for preventing leaks and dangling references.

 

Which reminds me, @NileshKumar. If you are going to be learning C++ on your own, make sure you find books/tutorials that focus specifically on modern C++. That is C++11/14/17/20. These should focus on proper use of STL, in particular, smart pointers. That will save you a lot of headache and make you a better candidate when you're looking for jobs. On the flip side, you do need to understand how raw pointers work, but that's what your schoolwork in C is going to get you. So if you learn C++ from perspective of a modern, memory-safe(ish) language and C from perspective of old-school low-level slightly-better-than-Assembly point of view, you'll eventually meet somewhere in the middle and have a full picture of all that is C++.

  • Like 1
Link to post
Share on other sites
  • 2 months later...

Alright I am trying to learn C++ by myself with practically no programming knowledge and it seems I cant compile a basic Hello World code without getting a host of errors. Can someone please tell this fool what is going wrong that he cant run even a simple program like this successfully?

 

Code (just an elementary Hello world code)

Spoiler
#include <iostream>
 
int main()
{
    std ::cout << "Hello World";
}

 

Errors

Spoiler
g++: error: Hello: No such file or directory
g++: error: World: No such file or directory
g++: error: programming\Hello: No such file or directory
g++: error: World: No such file or directory
g++: fatal error: no input files
compilation terminated.

 

I think the answer will most likely be simple and whoever reads this will laugh and I'll embarrass myself posting this but I just want to figure out what is wrong and get educated on this stuff, I'm stumped right at the beginning of my programming journey lol.

 

Edit: I'm using Visual Studio Code v 1.53.0 and the code runner extension for my compiler.

Edited by Wayne Kerr
Link to post
Share on other sites
23 minutes ago, Wayne Kerr said:

Alright I am trying to learn C++ by myself without practically no programming knowledge and it seems I cant compile a basic Hello World code without getting a host of errors. Can someone please tell this fool what is going wrong that he cant run even a simple program like this successfully?

 

Code (just an elementary Hello world code)

  Reveal hidden contents
#include <iostream>
 
int main()
{
    std ::cout << "Hello World";
}

 

Errors

  Reveal hidden contents
g++: error: Hello: No such file or directory
g++: error: World: No such file or directory
g++: error: programming\Hello: No such file or directory
g++: error: World: No such file or directory
g++: fatal error: no input files
compilation terminated.

 

I think the answer will most likely be simple and whoever reads this will laugh and I'll embarrass myself posting this but I just want to figure out what is wrong and get educated on this stuff, I'm stumped right at the beginning of my programming journey lol.

 

Edit: I'm using Visual Studio Code v 1.53.0

RIP

 

I copy pasted the exact same code in CodeBlocks and it is working, try reinstalling the complier

image.png

Link to post
Share on other sites

It seems I cant input any values in Visual Studio Code's terminal for C++. I ticked 'Run in terminal' in coderunner's settings but I get some '&& is not a valid statement separator' error. I'm new to this and dumb so I'd like some assistance on what has gone wrong here

 

the code

Spoiler
#include <iostream>
 
int main()
{
    int x,y,temp;
    std:: cout << "Values of x and y are-";
    std:: cin >> x >> y;
    temp=x;
    x=y;
    y=temp;
    std:: cout << "Exchanged values-" << x <<  y;
 
}

 

and the error

Spoiler

PS C:\Users\pc\C++> cd "c:\Users\pc\C++\" && g++ WAP2.cpp -o WAP2 && "c:\Users\pc\C++\"WAP2
The token '&&' is not a valid statement separator in this version.
At line:1 char:25
+ cd "c:\Users\pc\C++\" && <<<<  g++ WAP2.cpp -o WAP2 && "c:\Users\pc\C++\"WAP2
    + CategoryInfo          : ParserError: (&&:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidEndOfLine

 

The weird thing is this exact same error happens to my Hello word program on C++ too when 'Run in terminal' is ticked, but when its unticked the Hello World program runs properly. With this program I need to input the values in the compiler so I cant untick 'Run in terminal'. 

 

Can someone help on how to correct this?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.