General C++ Programming - July 2020 (Page 4)

issue with Aspose.Cells library for C++
 
Can someone please help me with my issue with Aspose.Cells library for C++? I was writing my first C++ programme using Aspose.Cells library. Everything seemed ...
[1 reply] : fatal error: boost/config/compiler/gcc.hpp: No such file or directory... (by fiji885)
Solving N-Queen problem using random picked queens
 
My idea is to store the position of the queens in an 1D array with queen =row and i = column, which is randomly generated in a way that no queen is on the same...
[8 replies] Last: @TomCPP Thank you, I'll have a look (by longdoan1511)
MMOSG development
 
Hi people! I'm with a problem. I want to create a mmosg so I'm going to use Allegro, SQLAPI ++, and nanoSVG for vector graphics. The only problem is that as the...
[3 replies] Last: Double posted - https://www.cplusplus.com/forum/windows/271609/ (by salem c)
i have too many files open?
 
I keep getting this error msg and I don't get why // open input file ifstream fin; // fin.open (usersFile.c_str()); // if (!fin.good()) throw "I/O e...
[2 replies] Last: you were right I defined codedMsg wrong. (by pnwadike99)
by volang
compare addresses - make sure one comes before the other
 
char str = "xz"; char * p1 = str; char * p2 = str + 1; Before I continue with another operation, I need to make sure that "p1 + 1" is positioned before ...
[10 replies] Last: #include <iostream> int main() { char str = "xz"; char * p... (by againtry)
Recursive function
 
The following recursive function has a return value of type unsigned int and two parameters of the same type. unsigned int f1(unsigned int a, unsigned int b...
[2 replies] Last: What is the return value of f1 with values 3 for parameter a and 6 fo... (by Hezigon)
return by address
 
why does for each (marked as //)in this code not work? i dont understand. is it because q is pointing to p which is data in heap so in main we cant access it? ...
[4 replies] Last: There is some confusion in the syntax between pointers and arrays. I ... (by kbw)
by Kaisha
converting from string to u8string
 
Is there a standard way (ie. apart from using something like WideCharToMultiByte()) to convert between string, wstring, and unicode strings? <cstdlib>, <cwchar...
[3 replies] Last: I think the answer is going to be to find a pro library that does this... (by jonnin)
Pointer-Pointer-Array not working
 
Hello, i'm trying to set up a class, in which I can have an Array which contains names. The problem is that the number of names(/the size of the array) depends ...
[2 replies] Last: @OP You could also design and use your own list - a set of nodes/point... (by againtry)
by nenchi
Logical error cannot be found
 
/*I am using Visual Studio 2019 for my c++ coding and i cannot find the logical error to my coding. When the user inputs their birthday, it should output their ...
[7 replies] Last: By the look of it and on reflection leap years aren't significant. (by againtry)
by volang
Setting values inside namespace/structs
 
Why is it possible to do following: namespace G { int a = 20; }; But not: namespace G { timeval timeout; timeout.tv_sec = 10; ...
[2 replies] Last: In C99 (and C++20) you can do: timeval timeout = { .tv_sec = 20 }; ... (by kbw)
How to google things and apply the answers to solve your own challenges?
 
Hello guys, The title says it all, I have noticed that things that I look for and apply take weeks before finally getting it done. while my friend was is in th...
[2 replies] Last: In short, you have to think . You usually can't just cut & paste som... (by dhayden)
ModernCppStarter & PVS-Studio Static Code Analyzer
 
The ModernCppStarter team suggested a Pull Request for ModernCppStarter on introducing the PVS-Studio static analyzer so that new projects could immediately emb...
[no replies]
how to represent a monetary type in C++?
 
Hi, No, I don't think using double is enough because the decimal part is an approximation in double. What I am looking is for a type that models monetary amo...
[3 replies] Last: The thing about a fixed point representation is that you have to set a... (by helios)
by thmm
Return type of generic function
 
I want to write a generic function where I can specify the return type like float, double... but get the following errors. I am using VS 2017 CE E0304 no inst...
[4 replies] Last: Thanks TwilightSpectre , that's even better. (by thmm)
[SDL] bugs with objects colliding
 
hey guys, I created two rectangle objects, I wanted to achieve random acceleration in random directions at any given point in time, I think I have partially ac...
[9 replies] Last: do you think this is a viable solution? (by adam2016)
crossword puzzle (1,2,3,4,5,6)
 
Which loop? You have several in your code, and I don't see any of them which looks like it has any checks for errors. Also, you would help yourself enormously...
[102 replies] Last: I created a workspace for this project: https://hyom.slack.com/files/... (by oneidacharisse)
random in class member function (1,2)
 
Hello what is the best place for srand(time(0)); in the main function ? at the beginning of the program ? or in the function itself as below ? #include <iost...
[22 replies] Last: I hope they add some novice-friendly APIs to <random> in a future ver... (by George P)
what is a type with value semantics?
 
what is a type with value semantics? and how does it differ from other types? should types with value semantics be passed by value to a constructor or method i...
[4 replies] Last: thanks a lot Cubbi, great references!! (by JUANDENT)
Random Number sorted and drawn as a sign
 
Hi, i'm trying to programm a game. For that i need random numbers sorted, so the biggest number is first : 31, 32, 41, 42, 43, 51, 52, 53, 54, 61, 62, 63, 64, ...
[7 replies] Last: #include <iostream> #include <string> #include <sstream> #include <ct... (by lastchance)
July 2020 Pages: 1234
  Archived months: [jun2020] [aug2020]

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