General C++ Programming - September 2012 (Page 30)

When are rvalue references to primitive integers short-lived or long-lived?
 
I have done some experimentation on rvalue references with the TDM-GCC 4.6.1 compiler and made some interesting observations that I cannot explain away with t...
[1 reply] : Returning a local variable by reference is undefined behavior, regardl... (by Cubbi)
Integer logarithm with base 2
 
Hi, I'm currently working on a template class which basically works just like the int type, but stores the (signed) integers in their binary representation u...
[6 replies] Last: Oh you're right. That's a nice and simple solution :) Problem solved,... (by AleaIactaEst)
Issue with program to automate excel
 
Dear C++ Gurus/Experts, I am writing a program to automate excel.My program is working well when I use integer (Write/Read) in excel.My program also works we...
[2 replies] Last: Thanks for your help Mr.Kbw.I am able to proceed further. (by Haroonrulz)
Reading Binary files
 
Hi, I am trying to write the code to read binary files which is generated by other system say X X generated the binary files using cobol code. it consists o...
[4 replies] Last: thanks i am able to read (by suryakalam)
by vw4x4
please give an example fot the following situations.
 
1)unsigned short is converted into int,if short is smaller than int.please give an example of this situation. 2)if two are of the same size,then unsigned short...
[1 reply] : 1) unsigned short x = 0; int y = 0; std::cout << typeid( x + y ).nam... (by vlad from moscow)
Issue with program to AutoSave excel in C++
 
Dear Gurus/Experts in C++, I am creating an automation tool, for that I have to autosave the excel with strings.I can read/write in excel, but when I try to ...
[no replies]
by vw4x4
uses of type conversion?
 
1) what are the uses of type conversion? 2)what are the uses of forcing data types to be stored as another data type? 3) 0x8000=32768. 0x8000 is stored as uns...
[1 reply] : 3. Because hex notation is typically used with bitwise operations. Bit... (by helios)
by ycai77
template programming problem
 
I encountered a problem where the template function defined in a separate file couldn't be found by the g++ compiler. Case 1: the template function is defined ...
[1 reply] : Back in 98, there used to be a keyword in the standard that let you de... (by helios)
Binary Trees and Linked Lists
 
Hi, I've been trying for quite a while now to solve this problem sheet but I can't seem to get an answer that seems remotely close. To make it worst I can't ...
[2 replies] Last: It's the last two questions, the combination of Trees and Lists (by clc0608)
C++11 - Using move semantics in a for loop?
 
Hi, there! Yes, you read the title correctly. But why, you may ask now. Well, allow me to demonstrate: for(unsigned int i = 0; i < vector.size(); i++) As y...
[5 replies] Last: Thank you for the replies! I didn't come to think of it that compilers... (by Henri Korpela)
String Manipulation Problem
 
Question: After dinner at a Chinese restaurant, Batman and Robin had a fortune cookie each. Both cookies contained the same fortune written on a single line ...
[2 replies] Last: thanks alot man. thats a really smart way of doing it. (by james16)
C/C++ compiler app, Nokia?
 
I have a Nokia N8, and want to be able to whrite and compile C++ 'on-the-go'. Does anyone know of any simple app download for the Nokia N8 to whrite and compile...
[2 replies] Last: Both codepad.org and ideone.com is what I'm looking for, a debug and c... (by Hashimatsu)
Program that finds the surface area of moon.
 
#include "stdafx.h" #include <iostream> #include <iomanip> #include <cmath> using namespace std; const double PI = 3.14159265; const double ...
[1 reply] : @kajondra Very impressive. Can you convert that to square miles? Also... (by whitenite1)
incomplete type is not allowed error
 
so this is the only error i have in my code but i cant figure out how to fix it, here is the code below. note its broken into 3 files. //date.cpp #include <io...
[3 replies] Last: What is the content of "date.h"? A am sorry. Please show anew your tes... (by vlad from moscow)
Question regarding Multiplatform (Linux AND Windows)
 
Hi, I have to create an application which can be executed in Linux and Windows. My question is : 1: Will i have two executables. Each for an environment? ...
[1 reply] : 1. Yes. It can be hard to make executables that works on all Linux dis... (by Peter87)
How to make the content of a 'char*' to 'char*'?
 
char chArray = "0123456789"; char* ptr = chArray; char* ptr1 = "chArray"; using namespace std; int main() { cout << ptr1<< endl; return 0; } When ...
[2 replies] Last: You could substitute ptr1 for ptr in the statement cout << ptr1<< end... (by vlad from moscow)
bitwise negation operator
 
can any one tell me how ~ operator works., int i=2; printf("%d",~i); when i did so, the o/p comes as -3,how..????
[3 replies] Last: ~changes all the bits of the variable, including the bit containing th... (by bartoli)
Help with ifstream and store dynamic array
 
Thanks vlad!
[11 replies] Last: Consider a simple example #include <iostream> void f( int x ) { x =... (by vlad from moscow)
by ljs
computing factorial using recursion
 
In many textbooks they use a function to compute the factorial of an integer using a recursive algorithm. Does anybody know if that is just because it is a nice...
[3 replies] Last: The problem is that not all compilers support the tail recursion. If a... (by vlad from moscow)
Recruiting C, C++ Developers
 
Experienced C, C++ developer for great job opportunity in Mexico. Send email to manueldl@mx1.ibm.com
[1 reply] : I am an experienced C/C++ developer including also expirience of writi... (by vlad from moscow)
September 2012 Pages: 1... 2829303132
  Archived months: [aug2012] [oct2012]

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