I know that there is no return type of the constructors in C++
However, the code below compiles right. What is returned by the constructor in the code below?
class A{
public:
A() {}
}
A a = A(); //what is returned by A() here, why?
Is there any conflict here?
...
From the C++0x working draft, the new char types (char16_t and char32_t) for handling Unicode will be unsigned (uint_least16_t and uint_least32_t will be the underlying types).
But as far as I can see (not very far perhaps) a type char8_t (based on uint_least8_t) is not defined. Why ?
And it's even more confusing when you see that a ...
If I define a non-member function in a header, will it always be inlined by the compiler, or does the compiler choose based on its heuristics? I know that __inline is just a hint, is it the same with functions in headers?
...
I'm looking at writing a shell extension so when a file is clicked an action can be performed against it. (Like any other context menu :))
What is the minimum i need to insert a new Menu Item in the Context menu and perform an action against one or more files. A comparative example would be that i selected 10 files and Send to Zip.
I...
I have a small to medium size project that I am doing for my software engineering course this semester. I have chosen to do it in C++ (gtkmm). I am doing okay so far but I have run into a problem with circular references or the following error presented below.
Login_Dialog.cpp:25: error: invalid use of incomplete type ‘struct MainWindow...
Hi,
I am using GCC on Mac OSX. I am trying to get GCC to create a map(or listing) file of all the symbols in the project so it contains the addresses at which they are mapped.
I read in the GCC manual that a way of generating such map files is to pass system specific flags to the GCC linker using -Xlinker option.
But I cannot find what...
I just found my code like this does not compile right? Is there any compiler-provided constructor here?
class A
{
private:
A(const A& n);
};
int main()
{
A a;
}
The error is
test.cpp:18: error: no matching function for call to ‘A::A()’
test.cpp:11: note: candidates are: A::A(const A&)
I am using g++ unde...
Hi everyone:
I'm currently writing my own virtual keyboard for linux using the X11 lib and i just can't find the way to simulate a KeyPress event of any dead keys.
I'd tried , for example, to write "á" using the asigned macro, which is XK_aacute, and nothing happens.
later i'd tried to send XK_acute (the acute accent macro) and then XK...
Hi all,
For some MATLAB code that I want to make executable, I need the location to a compiler in Windows. I have Visual Studio installed, so would I be able to reference the compiler that that uses? If so, how can I find it?
Thanks.
...
i want to parse following xml tags
<gains>5.640244e+03 5.640322e+03 5.640402e+03 5.640480e+03 5.640560e+03 </gains>
using c++..
can any one help me??
...
I'm learning C++ and I'm just getting into Virtual Functions/Methods.
From what I've read (in the book and online), Virtual Methods are methods in the a base class that you can override in derived classes.
But earlier in the book, when learning about basic inheritance, I was able to override base methods in derived classes without usin...
my Socket.cpp containing
// Implementation of the Socket class.
#include "Socket.h"
#include "string.h"
#include <string.h>
#include <errno.h>
#include <fcntl.h>
Socket::Socket() :
m_sock ( -1 )
{
memset ( &m_addr,
0,
sizeof ( m_addr ) );
}
Socket::~Socket()
{
if ( is_valid() )
::close ( m_sock );
}
bool Socke...
A friend of mine sent me this code snippet to celebrate his new baby birth:
void new_baby_name() { father_surname++; }
The snippet is from his point of view, he is the father and the new baby get the surname from him.
I answered with this:
class father_name {};
class mother_name {};
class new_baby_name: public father_name, public mo...
#include "ServerSocket.h"
#include "SocketException.h"
#include <string>
#include<iostream>
int main(int argc, int argv[])
{
std::cout << "running....\n";
try
{
// Create the socket
ServerSocket server ( 30000 );
while ( true )
{
ServerSocket new_sock;
server.accept ( new_sock );
...
Hi all. I have an image saved in tiff format which is 24 bits per pixel. May I know if there's a program written in C language or java that can convert the 24 bits per pixel to 48 bits per pixel?
...
I need to have a map like this :
typedef std::map<int, float , char> Maptype ;
What is the syntax to insert and searching elements of pair in this map.
...
Hey there, I'm having trouble separating numbers and characters from my input string. The purpose of my program is to add,subtract,multiply and divide in postfix
so i cant predict the input form as it can be anything from
2 2 3 + * (answer being 10) to 2 2 + 3 * (answer being 12). So i cant use sscanf to extract the numbers and the opera...
How do you create a window that pops up from system tray notification area vertically upwards and displays a message? for example - In MSN, it displays it when someone gets online/offline.
...
I would like to know about books that talk about design issues like when to use namespaces and other coding standards to write good quality efficient C++ code. One that talks about Code testing will also be appreciated.
Thanks
...
I am trying to write a program that has a vector of char arrays and am have some problems.
char test [] = { 'a', 'b', 'c', 'd', 'e' };
vector<char[]> v;
v.push_back(test);
Sorry this has to be a char array because I need to be able to generate lists of chars as I am trying to get an output something like.
a a
a b
a c
a d
a e
b a
b...