General C++ Programming - March 2020 (Page 7)

by zongul
Is it a good practice to avoid strlen
 
I was looking for some tips and tricks in C++ and saw that you can avoid the strlen or length() with array in the for loop. But is it really a good practice to...
[4 replies] Last: I have one addendum to @jonnin's point - use strnlen instead. strlen ... (by Niccolo)
Vowel Counter with Function
 
I cant seem to figure out a way to end the do while loop, rest of the code seems to work fine. The current way I end the loop isn't recognized. #include <iost...
[9 replies] Last: Thank you, can't believe I didn't think of that... you will get there... (by jonnin)
What is the best way to assign elements from queue to priority queue?
 
I made the following function called rearrangeSomething. I want to move all element from a queue to a priority queue. I think it's slow if I implement a functi...
[5 replies] Last: ^^^ That is slick. I have not spend enough time on the Q tools and wo... (by jonnin)
Homework Help
 
I need some help. This program needs to be able to read sales data from a text file. The items it needs are a product number which is an integer, a product name...
[4 replies] Last: Why do you have an array of pointers ? (by keskiverto)
i need a programming correction: what is machinelanguage? (1,2)
 
from school i had learned that the machine language is zero's and one's. but is these a language or the machine language is the Assembly(the CPU language)?
[38 replies] Last: thank you so much to all for all... thank you (by Cambalinho)
How i can remove and add blocks for my voxel engine
 
Hi i was making a voxel engine. That needed player destroy and place blocks. But how i can do that. I made map system loads from array. But i want player dynam...
[3 replies] Last: This is a little hard to follow. I know english is hard for you, but ... (by jonnin)
Hash Funcion improvement
 
Hi guys below is an implementation of a polynomial hash function, besides the huge waste of space ( yes I could have used a vector instead of an array but in...
[5 replies] Last: His! (by mbozzi)
by LuffyD
HELP WITH THIS UML
 
hello i have this UML diagram to make a class that will handle complex numbers, but i dont know how to actually , implement this on a header file, i understan...
[2 replies] Last: Thanks!!!!! , that actually helps (by LuffyD)
General Question about C++
 
So I am having a bit of difficulty with recursion. the part of my code that is sum += (num % 10 + sumDigitsOfString(num/10)); gives me an error which reads //...
[5 replies] Last: @PhoenixKing3317, Your code works fine as long as the int that you try... (by lastchance)
Maintaining QtCore
 
Rob and Jason are joined by Thiago Macieira from Intel. They first talk about Visual Studio’s Qt support, and articles from Bjarne Stroustrup and Herb Sutter....
[no replies]
No matching function call
 
Hey guys, I am trying to implement a hash map I am using the chanining method for collisons ie all buckets point to a linked list of key value pairs, anyway t...
[5 replies] Last: I would imagine it would be easier to transition to newer versions o... (by deleted account xyzzy)
HELP
 
Hi guys / girls, I'm trying to write code that prints the following : ******7 *****7* ****7** ***7*** **7**** *7***** 7****** Any ideas? I know I will be...
[1 reply] : You're off to a start. Obviously, not exactly where you wanted to go, ... (by Niccolo)
Clearing elements from a Queue
 
My program is basically reading a list of names from a txt file and inserting them into the queue and I have several options after that. My problem is for for ...
[3 replies] Last: Again you need to make sure the build is adding debug symbols and run ... (by jlb)
by ijcvan
For Loops
 
i need a hand with this assignment ASAP use for loop to request for 3 values to be inputted and sorted for the greatest number,and display the greatest value...
[1 reply] : 1) create a vector or an array 2 a) use a for loop 2 b) ask the user... (by adam2016)
Preorder thread bin tree to be true? (1,2)
 
I tried to arrange the code for the preOrder for the BinThreadTree. How can I arrange for them and make them true? template <class BaseData> bool BinThreadTre...
[27 replies] Last: Do you need all these classes? The code would probably shrink by 50% o... (by dhayden)
by Dgill
Negative character "-" sets program in constant loop
 
Hi I am very new to C++ programming. When using one of the tutorial programs from a book I am learning from I have encountered a bug in the program. It has got...
[3 replies] Last: Thanks for the tips; I'll give it a try. (by Dgill)
by Zanza
First program: Averaging 6 grades
 
I'm creating a grade averaging program for class that needs user input of 6 grades which are to be entered as strings and divide them by the total (6) for the a...
[6 replies] Last: #include <iostream> // I/O operations #include <iomanip> // Formatti... (by againtry)
C# Style Properties in C++
 
After reading this article: "http://www.cplusplus.com/forum/lounge/118961/", I decided to try my hand at creating a universal way of creating C# like properties...
[1 reply] : Nice work man! (by closed account Ey80oG1T)
inFile loop problem
 
Hello, Im using a inFile loop to read a .txt file everything is good until the output which reads the last line twice. Here is my code: //==================...
[2 replies] Last: Thank you so much, Ganado!! I appreciate it dude, you're a wizard. (by gus2427)
March 2020 Pages: 1... 567
  Archived months: [feb2020] [apr2020]

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