General C++ Programming - February 2019 (Page 8)

I Have a C++ Assignment I need help with. Please advise.
 
I am having troubles with my code. Can someone please advise the issue below. Thanks The Question: Write a C++ program that the Traffic Department can ...
[1 reply] : duplicate post. (by jonnin)
What is wrong with the following code? (itoa function)
 
Hello, I had a C++ interview question about the following problem. What is wrong with the following code? int main() { char* a = new char ; a = it...
[3 replies] Last: Why a = itoa(300, a, 10); and not just itoa(300, a, 10); What did the ... (by Grime)
coint counter w/ function not working
 
What am I doing wrong here, clearly it is not calling the amount of coins to the function because the total is giving me a weird output everytime. #include <i...
[8 replies] Last: cmath and math.h are the same thing, except math.h is for C programs. ... (by jonnin)
"static" as class member and linkage
 
Dear all, In C (or C' textbook), "static" is used as internal linkage, which declare the static variable only existing as different instances in the defferent ...
[5 replies] Last: I don't think I can give a good answer because I don't know enough abo... (by Peter87)
Increment specific vectorelements
 
I want to increment specific vector elements. I am opening and reading from a file and want to count how many a, b, c and all the way to z I have. I have made a...
[2 replies] Last: Oh gosh, rookie mistake. Thank you:-) (by theredp)
Pointer to elements in STL containers
 
Dear all, STL containers are inevitable to implement sequential or linked data collection. To improve efficiency of programs, I often consider to refer their...
[2 replies] Last: Dear JLBorges, Thank you for your rapid and accurate reply. Today, I... (by Mitsuru)
by frek
enum class
 
Hi, In the book the tour of C++ 2nd edition page 45, Stroustrup says: enum class Color {red, blue, green}; Color y {6}; // OK But in practice, I get the...
[14 replies] Last: I set that to /std:c++latest and it worked. But should I do that for ... (by Peter87)
calculating e^x without using exp() function
 
Hello, all. I am a freshman in college, and fairly new to coding. In my Computer Science I class, I have been assigned to code a function that calculates e^x wi...
[16 replies] Last: OK that makes a lot of sense now that you've explained it that way. Th... (by jordangt)
Array of Linked Lists?
 
I'm having issues trying to convert my code into an array of linked lists. I currently have a program that generates random cards until all the different face c...
[3 replies] Last: if you write your own list, you hopefully have been following your stu... (by jonnin)
"printf" did not work
 
i have a problem that "printf" didint show what i want <printf ("objFunction = %d \n", objFunction);> its show objFunction=0 the right one is objF...
[2 replies] Last: Sigh, duplicate. http://www.cplusplus.com/forum/general/249643/ (by Duthomhas)
3 parameter function conversion errors.
 
The key function returns an integer value from a key input. Which then i input into the d function to move the snake around using the snakex and snakey variabl...
[1 reply] : Hi, The key() function is supposed to input in the the d() functio... (by TheIdeasMan)
Class specialization by lvalue vs. rvalue argument
 
I am trying to write a templated class that is specialized depending on the value type (lvalue/rvalue) of one of its constructor arguments. The example hereu...
[1 reply] : I found the solution! Just needed to remember that int, int& and int&&... (by CABrouwers)
by helios
Joining identical class interfaces
 
I have these two classes: class A{ public: template <typename T> void foo(T &x){ /*...*/ } template <typename T> void bar(T &x){ /*...*...
[6 replies] Last: Here's an idea: class AbstractSerializer{ protected: virtual voi... (by helios)
Array
 
Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except...
[2 replies] Last: Please note that this is not a homework site. We won't do your homewor... (by keskiverto)
by vibhu
which Data structure kernal uses for memory management.
 
Hi , I have very basic understanding that for memory management kernel uses c functions like malloc(), realloc() ... but don't know which data structure it use...
[7 replies] Last: fine thanks once again... (by vibhu)
string task
 
so i need help . We have 2 strings. We have to delete every little string which is contained in string №2 . for example : "Hello there", "llo" → "He there" ...
[4 replies] Last: I won't do it for you either, but how about a hint or two: look at str... (by jonnin)
Pixel Bitmap font for OGL
 
Hello Could someone offer their opinion (or statements of fact :)) on which method is the best way to render a bitmap font in OpenGL? Most tutorials I have fo...
[12 replies] Last: Yes, that's how state transformations work in OpenGL. It's analogous t... (by helios)
cannot convert from "void" to "std::basic_string"
 
I am writing a Bull Cow Game program and am getting a weird error in my header file. The error is: "'initializing': cannot convert from 'void' to 'std::basic_...
[4 replies] Last: The error is: "'initializing': cannot convert from 'void' to 'std::ba... (by Peter87)
How to separate functions and main file?
 
Hi everyone! I'm making a little project that suddently grow up :) I have 42 functions, many of them call other functions , so it's becoming a mess to scroll t...
[6 replies] Last: i don't know 'size_t', i'm a beginner, so i prefer my rough code. S... (by jlb)
Some overhead relating to standard library
 
Dear all, I think about overhead relating to standard library and language specification when I wrote high performance codes. If you know the least, I wou...
[12 replies] Last: Dear Cubbi Thank you for your detailed and kind comment. I believe c... (by Mitsuru)
February 2019 Pages: 1... 67891011
  Archived months: [jan2019] [mar2019]

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