General C++ Programming - November 2016 (Page 19)

is this allocated in the heap or stack?
 
Given this example: struct Example{ int number; string word; }; struct Node{ Example ex; Node* next; }; int main(){ Example someObject; ...
[2 replies] Last: Sorry, but by "yes" you mean my analysis is correct or that it will in... (by anarelle)
pow function
 
hello. i have this program void p2 (int & n, int & x) { x=0; pow(x,2)=0; while(pow(x,2)<n) { pow(x,2)=pow(x,2)+2*x+1; x=x+1; ...
[2 replies] Last: What's the error? (by kbw)
Vowel C++ program
 
I need some help on how to work the GO again and prototypes functions write a c++ program that asks the user for a single character value, but over and over, f...
[6 replies] Last: thank you. I got it to work (by Kevin10official)
Rock Paper Scissors Lizard Spock program help
 
Need to write a rock, paper, scizzors program with following retraints: Make sure to have one function displaying the menu (scissors, paper, or rock), reading ...
[4 replies] Last: That worked perfectly, thank you very much. I had tried a do while loo... (by adeclue)
Pointers
 
Please help me with line 45: #include <iostream> #include <cstring> using namespace std; int SpacesRemoval(char* Str); int main() { char Str ; ...
[5 replies] Last: #include <iostream> #include <cstring> using namespace std; void re... (by SakurasouBusters)
by JM0911
Program compiles, but crashes
 
Hello, I wrote a program to calculate the average of some scores and sort them in ascending orders. It compiles, but the crashes after I enter the number of sc...
[11 replies] Last: The intended way to run text-console programs is from the text-consol... (by mbozzi)
How to serialize a float?
 
Of course you can just cast it to char array and write(or send) it like that, but that would only work if all machines have the same byte order for floats. F...
[5 replies] Last: You're right. But float in C and C++ is (usually) IEEE754 single-pr... (by mbozzi)
Expression Must have class type
 
Hey guys, I'm new here but I could use some help. I don't want to post a wall of code so I'll try to be short and specific here. I'm trying to pass an array of ...
[1 reply] : Do you notice any mismatch in these: void initialize( Ship ) void i... (by keskiverto)
by dkaip
c++ sqlite encrypt
 
Hello. Using sqlite3 i have the c++ code ... if (sqlite3_open("myFile.db",&db) != SQLITE_OK) { wxMessageBox("Could not open database."); ...
[4 replies] Last: SEE i expensive for private use and small programs.. Maybe must use sq... (by dkaip)
by Gyiove
normalizing matrix in row ways (Eigen)
 
Hello everyone! I have matrix: typedef Eigen::Matrix<F_TYPE, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> matrix_t; matrix_t m(2, 3); m(0, 0) ...
[3 replies] Last: Good thing about Eigen lib is that you can make those matrix calculat... (by helios)
I really can't explain this behaviour
 
I've made a simple byte array buffer that serializes and deserializes floating point numbers by casting them to unsigned char* From my tests I can see that I...
[8 replies] Last: Ahhh now I understand. I must have made the mistake when I copied the... (by zoran404)
Need help tweaking a code - c programming
 
Write a program that asks the user how many numbers she would like to compare; Then accepts her inputs. The program should output the largest, the smallest and ...
[1 reply] : "I'm just not sure how to change it so that it allows the user to inpu... (by zoran404)
Passing Arrays to Functions
 
C Language Write the definition of a function reverse, whose first parameter is an array of integers and whose second parameter is the number of elements ...
[1 reply] : All 3 of those functions are identical. And I believe the algorithm is... (by zoran404)
Help with counting array elements- C programming
 
Given an int variable k, an int array incompletes that has been declared and initialized , an int variable nIncompletes that contains the number of element...
[1 reply] : Correct code : numberOfIncompletes=0; for (k=0; k<nIncompletes; k+... (by lFoxiel)
boost::filesystem::remove_all compile error
 
So I am trying to delete a folder and all subdirectories, files, etc. I'm using boost/filesystem.hpp for this. But when I try to do boost::filesystem::remove_...
[8 replies] Last: I do not know anything about this C4droid tool-chain, let alone how to... (by JLBorges)
by JM0911
Initialize unused elements with 0
 
Hello, I have written a program that should create two arrays, one double the size, and initialize all unused elements in the new array with 0. That is the par...
[4 replies] Last: Nailed it, thank you!! (by JM0911)
Boolean function returns 1iff reversing arrays n elements is same as the original array
 
Bool isSymmetric(int a ,int n) ; The function returns true if and only if the array obtained by reversing the first n elements is the same as the original arr...
[8 replies] Last: After 2 fails, the third try isn't worth much buddy, sorry. But good... (by Arslan7041)
Classes and Object problem
 
I'm having trouble in our final project mostly dealing with classes and objects #include<iostream> #include<string.h> #include<conio.h> using namespace std; ...
[2 replies] Last: We haven't tackled about vectors yet but it wouldn't hurt to add it to... (by hpacleb)
Help with array assignment.
 
Here are the rules for the program... (1) Create a function that displays a two dimensional array. The example uses a 35 X 35 array. If the stored value is 0,...
[5 replies] Last: Instead of (or at least in addition to) storing where the animal is in... (by doug4)
File stream problem
 
Hello all, so I'm struggling to understand what's wrong with my code. I'm using visual studio, and I'm trying to put a long file into an array. But for some r...
[2 replies] Last: Well, according to other forums, I tried inserting it in the project d... (by aaronjmcd2)
November 2016 Pages: 1... 1718192021... 23
  Archived months: [oct2016] [dec2016]

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