General C++ Programming - February 2015 (Page 25)

Error with Tilde Bitwise Operator
 
Let's examine the code. int x = 100; unsigned long answer1 = ~x; unsigned long long answer2 = ~x; cout << (bitset<32>) x << "\n"; cout << (bitse...
[1 reply] : int x = 100; In this case ~x is a negative number. When you assignin... (by MiiNiPaa)
Use of pointers
 
When using pointers, when is it appropriate to call free ? In the following code, I allocate 4*4 bytes of memory, deallocate it and then allocate 4*7 bytes of...
[19 replies] Last: Why? (by LB)
by KrtinN
Quiz Program
 
Hi, I am working on a program. There is a .txt file that has quiz questions, multiple choice answers and what the correct answer is. I have figured out h...
[3 replies] Last: Conceptually, that is irrelevant. The file has a list of entries. Yo... (by keskiverto)
External Library Help!!!!
 
So I want to download an extrenal library called see.h. However, I'm not sure where to put this like in which folder. I have DEV C++. Please help I need this ve...
[3 replies] Last: It doesn't really matter, as long as you do what I said in my previous... (by MikeyBoy)
Having Trouble/I do not know what is wrong.
 
Well, I'm trying to make a Permutation/Combination calculator and I'm getting weird errors when trying to compile like so: Undefined symbols for architecture x...
[2 replies] Last: I fixed the prototypes, but now I'm having problem with the wrong outp... (by Engineering)
Switch statement
 
Not all people are lightly active, and people who exercise may need to eat more. This section adjusts for a person’s activity level and then adjusts the outpu...
[no replies]
by begha
Efficiency: Linked list or sorting an array?
 
I have an algorithm and I want to make it as efficient as possible. Basically it just involves putting numbers in order. I have two options, but I have no idea ...
[4 replies] Last: > 2. Using a container to store all the numbers first, then sorting th... (by JLBorges)
by Wagari
Is Linking array content with a string possible?
 
I am trying to write a code for a simple calendar/to-do list program which prompts the user to enter the desired month, and when the user does so, the calend...
[1 reply] : std::string appoinment ; (by ne555)
How to change values of an array? then display?
 
how can i change the array value and display the updated value. for example this is the output beginning of the program -------------------------------------...
[1 reply] : #include <iostream> #include<string> #include<map> #include <cstdlib>... (by sujitnag)
problem in search (1,2)
 
#include<fstream.h> #include<conio.h> #include<stdio.h> #include<string.h> #include<process.h> class car { public: int carno; char model ,mf ,chno ,c...
[21 replies] Last: So, what is your problem? Search Menu ... (by MiiNiPaa)
Comparison of Two XML Files
 
Hi guys. I need a program that can compare two xml files for equivalency using any XML Parser .Any kind of guidance will be helpful.
[2 replies] Last: @ajh32: Do "abc" and "bac" have the same hash? XML is tricky, because... (by keskiverto)
operator[] return type
 
#ifndef MATRIX_H #define MATRIX_H #include <vector> using namespace std; template <typename Object> class matrix { public: matrix( int rows, int cols )...
[2 replies] Last: What they try to say is that if the line 23 would return a non-const ... (by DyslexicChciken)
Temperature Program
 
How would you be able to show both outputs celsius and Fahrenheit and my temperature conversion is coming up wrong when i enter in the input. here is my code...
[1 reply] : The formula for celsius -> (fahrenheit - 32) * 5/9 How would you be... (by coder777)
understanding Makefile
 
i know it's unix related, but i'm having a hard time getting some response. If anyone could guide me in the right directed or help explain what I'm mixing up, i...
[1 reply] : Read Chapter 2: An Introduction to Makefiles in this tutorial https://... (by JLBorges)
by Olaf
how to correctly initialize instances of a class?
 
I am not a C++ wizard, so please excuse me if this question is completely stupid. I am struggling to understand what the correct way to initialize instances...
[6 replies] Last: Perfect. For future reference: "uniform initialization" and "C++'s 'Mo... (by Olaf)
Bubble Sorting a linked list?
 
Hello, I am relatively new to C++ and am trying to bubble sort my linked list that creates 100 random integers. Everything works, but I am unsure how to continu...
[1 reply] : There are two ways to re-order a list. You either swap values or chan... (by keskiverto)
by wahhaj
Dynamically changing array elements inside of structures
 
I'm learning pointers and references in class and I have run across what I believe to be a syntax problem which I don't understand. I have a structure with two ...
[4 replies] Last: I got it, thanks for helping out (by wahhaj)
Key with Modifier
 
I am new to C++ , i want to know how to check if a key with modifier is pressed. When i use GetAsyncKeyState() it gives me error identifier not found
[1 reply] : Can someone help me please? (by Mora Hannover)
by JohnyL
Excel XLL returns different results
 
Hello everyone! I am using Excel 2013, Visual Studio 2015. I began learning about Excel XLL. I wrote simple function which tests whether the argument is missin...
[2 replies] Last: @MiiNiPaa Thanks a lot! Yes, I completely forgot that operands are c... (by JohnyL)
Output the Correct Standard Deviation
 
The program does compile the average and the mean correctly. I can't understand why the standard_deviation member function isn't applying the sqrt properly: ...
[7 replies] Last: You guys are awesome!! it worked. My program is outputting the correct... (by ep7network)
February 2015 Pages: 1... 23242526
  Archived months: [jan2015] [mar2015]

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