General C++ Programming - July 2016 (Page 7)

program not giving any output
 
using namespace std; template<class T> void Bubblesort() { T *unsorted, swap; unsorted = new T ; srand(time(NULL)); cout << "1" << endl; for (int ...
[4 replies] Last: Does that help you? :) (by Naughty Albatross)
Keep struct variables private outside, but public inside class
 
Hello. My class looks something like this: template<typename T> struct Node { T value; Node* left{ nullptr }; Node* right{ nullptr }; }; template<typena...
[3 replies] Last: You could return a bool. int main() { GTree<int> my{ 10 }; my.... (by Thomas1965)
How static linking is done with qt creator?
 
Hi I have created a simple program using Qt creator. I know how to dynamically link it, but don't know, how to compile it statically. My Qt version is 5.7.0. ...
[6 replies] Last: After many tries, I could fix it. Thanks so much cplusplus forum. (by omer123)
C++ inheritance
 
Can someone please explain how to do this? Write a program to calculate bill amount upon given constraints 1 use constructor for variable initialization. 2 M...
[2 replies] Last: Hi, Well, best place is at the point where you realise this isn't a ho... (by Naughty Albatross)
Vector arrays
 
I made some code using vector arrays. However i have some errors in my code. Here it is: int _tmain(int argc, _TCHAR* argv ) { const int people = 10; ...
[8 replies] Last: There are a couple of ways you could do it easily. You could create a ... (by MrHutch)
multidimensional arrays/2d arrays
 
HEY my name is Vanessa and i need help big time on an assignment to add to my gpa. The question is as follows. I have no idea what to do. PLEASE HELP!!??? (Oh a...
[5 replies] Last: FILE * a = fopen ("input.txt", "w"); You need to open the file for r... (by Thomas1965)
Having Trouble with getline() w/ Linked List
 
Hi Everyone, I'm having a bit of trouble understanding what is happening with my program when i'm running it. problem: When it runs it asks for each entry o...
[2 replies] Last: That Thomas1965, I'll try that an see how it turns out. (by TheCodingOne)
Electrodynamics & Grapics
 
Hello! Can someone adwice a library for electromagnetic field simulation in C++? I have E and H fields for every moment and in every piont and I need a way to ...
[3 replies] Last: Also I will be pleased if you will share knowledge about the simulatio... (by umka6970)
How can one constructor call another in C++?
 
I know this is not possible in earlier versions of C++. However, I don't know if it is supported now. I have the following constructors: int_vector::int_v...
[11 replies] Last: The term auto-magic is Stroustrup's, not mine. No worries :+) I wa... (by TheIdeasMan)
atomic operator=
 
when 'return a value' and other threads store the atomic, a race condition will happen?
[4 replies] Last: To see the 'current' value of an atomic object (instead of a snapshot ... (by JLBorges)
atomic : is_lock_free
 
//I can not get the significance of 'is_lock_free' #define _ENABLE_ATOMIC_ALIGNMENT_FIX #include <atomic> #include <iostream> #include <string> #includ...
[7 replies] Last: Thanks. It is so complex! (by Wu zhen hai)
How to resolve these compiler errors
 
There are these four functions i have called consecutively from main but the compiler shows the below errors, what do they mean ? Error 1 error LNK2019: unr...
[18 replies] Last: It would be rude of me sleeping without saying thank you to all progra... (by Mwangi Elijah)
Alternatives to Std::tuple for returning more than one value from a function
 
Hello, I would like to know if there is an alternative to std::tuple and passing by reference for returning more than one value from a function. One value w...
[7 replies] Last: It's a very sad truth that error checking is largely ignored in comput... (by dhayden)
Ignoring the Space
 
Yeah, I'm back with another question. My code works like this: You write a message (heLLo), choose a key value (e.g. 3) and the result is khOOr (3 letters forwa...
[12 replies] Last: Glad it helped :) (by Naughty Albatross)
by hm2251
3 attempts for access code. sequential search
 
Hello everyone it's nice to meet you all this is my first time posting on here. I'm having a little trouble with developing a c++ code. Basically I have to mak...
[7 replies] Last: Thank you soooo much for the help. the program works fine. (by hm2251)
what does those 2 founctions mean ?
 
void test (void) { #if WMOPS multiCounter .Test++; #endif } void move32 (void) { #if WMOPS multiCounter .DataMove32++; #endif }...
[6 replies] Last: You're welcome. (by MikeyBoy)
Letter to number and number to letter
 
Maybe this is a homework question, but I can't find a way of solving it... In my code, you put a message to be codified (hello), put a key value (e.g. 3) and th...
[7 replies] Last: Got it!!! Thank you! (by closed account 21vXjE8b)
Switch statement in C question
 
if a switch case is given as mask=0x01 switch (Buffer & mask) { case 1: --- if else case 2: ------ if else default: } I am doing unit t...
[3 replies] Last: Does it help you? :) (by Naughty Albatross)
The code skips getline() !!!
 
Hey guys! I don't know if here is the right place for my question. Sorry if it isn't! Yesterday I started working in an encrypting machine. It worked fine, BUT...
[4 replies] Last: Thank you Chervil! It worked! (by closed account 21vXjE8b)
is Array == Array condition allowed?
 
Can I treat, say char like a std::string? For example, can I do this: char text = "sometext" if (text != "someothertext") text = "someothertext"; Or do I h...
[12 replies] Last: Yep, well done glad to help. ;) (by closed account 48T7M4Gy)
July 2016 Pages: 1... 56789... 13
  Archived months: [jun2016] [aug2016]

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