Beginners - May 2021 (Page 2)

by sam1x1
write to file using a function from a custom class
 
so i need to write out my results to a text file named results. i'm not sure how to translate my code which just uses cout. i thought i could just change cout t...
[9 replies] Last: this all seems to be working... #include <string> #include <iostre... (by markyrocks)
sqrt with newton for four float values
 
Currently i have to implement the square root operation using the newton method. For this i have to implement some functions in a header file. The rest is alrea...
[4 replies] Last: I do not know what you mean about windows. I ran this in vs 2019 and i... (by jonnin)
by kmce
ADT / concrete types
 
Hello, I am having an issue fully understanding ADT / concrete types, no matter how many other posts i read about this i still cant fully understand it, and the...
[5 replies] Last: And I was not trying to pick on keskiverto; my comment was just that ... (by jonnin)
by alexas
the correct use pointers and references
 
I have the following function, which is tested and works fine: check_gjk_intersection(struct bd *bd1, struct bd *bd2) The structure contains of bd....
[7 replies] Last: The very complex function I am using is written using the pointers. T... (by alexas)
Graph vertex coloring algorithm taking too long. Passing arguments as reference
 
I had a similar question recently and the answer was that I should pass the arguments by reference. Which I now did and the code seems to be working much faster...
[5 replies] Last: I'm honestly wondering if a recursive function is necessary here and m... (by markyrocks)
Error in compiling C++ in Linux server
 
Hi, I'm working on a project dealing with Binary-Decision-Diagram(BDD) using CUDD, which is a package for BDD manipulation. The header files included in my mai...
[3 replies] Last: > Cause I've already used this path to replace $CUDD. What? echo $C... (by salem c)
Command for compiling C++ on a Linux server
 
Hi, I'm working on a project dealing with Binary-Decision-Diagram(BDD) using CUDD, which is a package for BDD manipulation. And there's a simple question, whic...
[4 replies] Last: Oh, right! That's the problem! Thx a lot! (by calvinfornia)
by Zetrox
C++ multiply function help
 
Im new cpp learner im trying to create a multiply function to multiply 3 numbers variables, when i want to compile it , it gives me an error in the line 12, i ...
[2 replies] Last: Thank u for reply, i understand now! Thank us so much for ur help , re... (by Zetrox)
size of vector when created?
 
Hi, When a vector is created is it just a random size? or has the pointer to the heap just been established and it just points to one block of memory, and then ...
[2 replies] Last: for array like behavior: vector<int> sized(100); //100 locations ready... (by jonnin)
How to store ascii values of string in vector and print them out
 
a is a string. I want to store the ascii values of each character of the string in a vector and also print them out. How do I do that? vector<string> vektor;...
[3 replies] Last: oh, if you want the int value, you can also get that from the string w... (by jonnin)
More elegant way to add object arrays to a longer array?
 
I'm using a union so I can break my ints and floats into bytes so they can be saved to an eeprom by a microcontroller. There are 12 "banks" each having 12 objec...
[9 replies] Last: I believe it writes bytes to I2C from sequential memory. Any other ty... (by jonnin)
by saam
prediction
 
I have tried to figure out why my code doesnt work the correct way. I want to compare prediction market with current bid. when i tried with my simple test.csv t...
[3 replies] Last: 3540 entries (by saam)
End threads after 30 seconds execution
 
Hello everyone, I want to stop the execution of some complex function after it runs for 30 seconds. I find some references saying I should use thread, but pp...
[6 replies] Last: fork() is probably the easiest way to do it. https://man7.org/linux/ma... (by helios)
Can C++ headerfile include C headerfile
 
Hi, I'm working on a project dealing with Binary-Decision-Diagram(BDD) using CUDD, which is a package for BDD manipulation. After browsing the source code of CU...
[1 reply] : most likely you can just use the c++ wrapper. A lot of code is buil... (by jonnin)
Subtracting two pointer in C - Structure
 
Hello, I expect x to be 16 but it is 1 #include<stdio.h> #include<stdlib.h> struct my { char fChar; char sChar; int fInt; int ...
[3 replies] Last: int main() { my myStruct {{'a', 'a', 1,1}, {'b', 'b', 2,2}}; ... (by againtry)
Print the elements of a given perfectly balanced tree
 
Hello everyone. I need your help, it's very important for me, please help me. Print the elements of a given perfectly balanced tree in descending order
[2 replies] Last: To print in ascending order (assuming the tree is ordered as well as b... (by seeplus)
by peza
How to compute & compare average of numbers stored in struct
 
Good day, I am having a hard time trying to make this certain segment of my program work, it should compute for the average of the 2 scores of the players and o...
[4 replies] Last: Hello, thanks for the corrections and I sincerely apologize because I ... (by peza)
Not a Type Name
 
"Sorcery*" and "<Enchantemnt*>" is not type name. Believe it or not, did NOT have this error yesterday. I don't know what happened. But I didn't change anythin...
[7 replies] Last: +1 to @keskiverto. If you think 7 header files is a lot, you have a l... (by doug4)
Not the pointer needed
 
DamageCreature is being initialized as a Cards* DamageCreature, I want to initialize it as another pointer. If you guys need my header files added please say so...
[6 replies] Last: You can 'go up' from derived towards the base (upcast) but can't 'come... (by seeplus)
Printing data to terminal
 
Hi all, I am trying to print the log file information to the terminal and I am using the below code to do so. But here I am able to print to the terminal onl...
[2 replies] Last: Thank you so much for the suggestion @Handy Andy (by Shruthi LS)
May 2021 Pages: 1234... 10
  Archived months: [apr2021] [jun2021]

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