General C++ Programming - May 2020 (Page 6)

When to use const char * over std::string?
 
When should you use const char * over std::string ?
[9 replies] Last: Another case are dynamic link libraries that may be consumed by other... (by kbw)
D.exe not found
 
I created an empty project called "D" for c++. I just do the basic hello world program and it works just fine. The problem comes when I try to build the same he...
[6 replies] Last: Thx guys (by MrRobot)
by tsuraj
use of if else
 
the code run,there is no error but the output is else condition whenever input character are entered same how can I modify, Want to know appropriate use of...
[5 replies] Last: You need to fully understand what was said above, but basic conditiona... (by jonnin)
Reference to one of many objects
 
I have several different objects, each with a common base class. Id like to create a base-class reference to the i-th object. Is there a better way than: B...
[5 replies] Last: I can't use an array as each object is a different class, though all i... (by PhysicsSteve)
Function declaration best-practice?
 
Let's say I'm developing a logging functionality. Inside `logging.h` I declare the function to be used by the application later on. // logging.h #include <st...
[3 replies] Last: I have somewhat different suggestion: 1. Users of your logging interf... (by malibor)
by dkg123
the good ol EXPECTED unqualified ID before 'public'
 
this error has my program completely hung code in q: #include <iostream> #include <string> #include <fstream> #include <cstdlib> #include <ve...
[6 replies] Last: Please fix the "wack indentations" and remove most of those "wack doub... (by jlb)
STL
 
I am a bit stuck on this question for my assignment int find_first(list<string>& data, string query) { ... } Implement the above function. It should fi...
[3 replies] Last: yes, you need to return a container (any type) of all the indices. i... (by jonnin)
General parser - Error handling
 
Hello everybody, I'm writing my own general parser. I know many will ask me why? The reason is simply that I like to code my own libraries, and that I learn ...
[5 replies] Last: To start, you need to store the line and position number with the cur... (by AngeSurTerre)
Tips and examples for Movie Inventory
 
So currently I'm doing a final project for my C++ course, this time it's a bit more open-ended. Thing is, there are several conditions that must be met and I'm ...
[14 replies] Last: #include <iostream> #include<string> #include<vector> #include<except... (by Kitsunetsuki)
C++ Is Faster and Safer Than Rust: Benchmarked by Yandex
 
This article continues a good tradition of busting myths about the Rust language shared by some big-name Russian companies. đź”—https://www.viva64.com/en/b/0...
[1 reply] : Are these just pvs-studio plugs? (by kbw)
Having wierd problem ASAP help please :)
 
Hello, I am trying to create vector of a class on another class. now i did created vector of different class in the same way i try to create for this class b...
[4 replies] Last: The problem is that gameState.h includes Addons.h and Addons.h include... (by dutch)
How do compilers manage a dynamic type in a static
 
How do compilers manage a dynamic user-defined (eg. string) type in a static array type. How to perceive and explain their working compile mechanism ? #inc...
[1 reply] : What do you think the problem is? The string data does not need to fit... (by dutch)
STL map container
 
I currently have this ode but I am not sure how to do the following question. #include <list> #include <string> #include <iostream> using namespace ...
[4 replies] Last: The link has: map<char,string> mymap; mymap['a'] = "an element"; Le... (by keskiverto)
What is an iterator in general?
 
An iterator is an abstraction, everything that behaves like an iterator is an iterator. In std::vector and std::array it's just a pointer, in other classes it's...
[5 replies] Last: @Cubbi Ah yes indeed!, increment/decrement is not the same as with pl... (by malibor)
C++ “delete” used in comma separated multiple array name
 
Is it valid to use single C++ “delete” in comma separated multiple array name, e.g. delete objA, objB, arrayA, numA; And so is the qualifiers used suc...
[15 replies] Last: I really do not like that evaluation order is undefined for subexpres... (by dhayden)
I want to Inset element in array
 
I am using a sample program to insert element in array and it work all the way to the number to insert and locks up. Help please. I am using CodeBlocks to comp...
[1 reply] : for(i=5;i>=pos;i--) a[i+1]=a ; In the first 2 for loops you knew that... (by Thomas1965)
Pointer and Reference
 
Reference are the constant constant pointer, Unlike pointer Reference can not initialize with NULL. Also Reference don't have their own address, Its just th...
[3 replies] Last: That makes sense. But the post must've been removed through reporting ... (by dutch)
Issue with C++
 
Morning, i have a problem with C++, i finished my algorithm and the following massage appeared: undefined reference to 'WinMain' id returned 1 exit status ...
[6 replies] Last: Thanks you all, but it was vey simple, i puted a space between "int" a... (by CancerJack)
by Zero3K
Compilation errors are occurring when compiling a driver
 
Can someone help me fix them? The errors are in the paste located at https://paste.ee/p/husrG . They are the errors involving ac97smpl.
[3 replies] Last: Also, look at http://www.cplusplus.com/forum/general/270305/ for anoth... (by Zero3K)
My 1 month projects - asking for tips and ways to improve
 
*I posted this 2days ago in begginers topic but i got no comments or attention so i thought maybe it will fit here more i know im asking alot here but i will ap...
[11 replies] Last: void AssetsManager::loadTexture(string name, string path) Passing st... (by Thomas1965)
May 2020 Pages: 1... 456789
  Archived months: [apr2020] [jun2020]

This is an archived page. To post a new message, go to the current page.