Thanks. Basically what I want is that: I want a big picture of function call relationship in a source code. Given a function I can know who's the caller, and who are the caller's callers, etc. I want...
Type: Posts; User: meili100
Thanks. Basically what I want is that: I want a big picture of function call relationship in a source code. Given a function I can know who's the caller, and who are the caller's callers, etc. I want...
I am reading a big source code and got confused by function calls/ class inheritance.
I was wondering if there is an off-the-shelf tool to show the relationships between the function calls.
Is...
I think it's not "read only". In fact you can modify it:
Char x [] = "abc";
x[0] = 'z';
The memory that x points to is NOT a literal.
If it's
Char * x = "abc";
I think you are right.
But for
Char x[] = "abc";
I think compiler allocate 4 bytes memory on heap and copy "abc\0" to the space.
Am I right?
Thanks. x is defined at global scope. I think it's on heap, right?
Where does compiler allocate memory for "abc" that x points to?
I think it's on heap. Am I right?
(assume Char x[] = "abc" is defined at global scope)
Added: Please note that I mean the "abc" x...
class Base{
public:
void foo(){cout<<"base foo"<<endl;}
};
class Derived: public Base{
public:
void foo(){cout<<"derivde foo"<<endl;}
};
Thanks lot.
1) Why strchr needs 0xFF with 0 at the beginning? Why not eof = "\0xFF"?
2) Why strchr does not need to escape 0 ?
Why the following code prints "Huh?" ?
It seems that 0xFF is never appended to the list by strcat?
#include <stdio.h>
#include <string.h>
const char * const eof = "\0xFF";
char list[2000]...
I write the following code. It seems that a nested class (inner class) can access its parent class's private member. BUT in the book <thinking in C++> 's chapter :introduction to template, it...
I am following the http://www.parashift.com/c++-faq-lite/templates.html#faq-35.16 to write the snippet below:
template<typename T>
class Foo {
public:
Foo(const T& value = T());
...
I copied the exact code from MSDN here http://msdn.microsoft.com/en-us/library/f1b2td24.aspx
// template_friend1.cpp
// compile with: /EHsc
#include <iostream>
using namespace std;
...
It seems that Derived class still can access Base::z?
class Base{
public:
int z;
Base(){
cout<<"Base::Base()"<<endl;
}
~Base(){}
inefficiency in terms of what?
JAVA has "instanceof". Why C++ only has "typeid" and "dynamic_cast"?
Is there any reason or concern JAVA implements it but C++ doesn't?
From Effective C++, by Scott Meyers :
"Anytime you find yourself writing code of the form "if the object is of type T1, then do something, but if it's of type T2, then do something else," slap...
Thanks. I am a C++ programmer and just want to quickly get started with java for simple JAVA programming.
This book seems not be a good learning book. Any book to recommend? Thanks.
Is this book, <JAVA in a netshell> 4th ed, a good book?
http://www.amazon.com/Java-Nutshell-Fourth-David-Flanagan/dp/0596002831/
Has anybody read it? I am a C++ programmer and just want to...
Thanks all,
gg: Your links don't work?
CornedBee: I still don't understand why the first is better in terms of avoiding spurious wakeups. Would you elaborate more?
Suppose multiple producers and consumers share a common queue.
Consumers are signaled when any producer puts data to the queue.
1. Does the following code has race condition?
//Producer:...
Nope neither helps. I almost give up. Thank you anyway for the help.
Yes, my backspace works correctly.
Got it. It seems that this post does not apply to my case.
When I press down "Delete" Key, the screen shows ~ rather than ^H or ^?
I tried
stty erase ~
or
stty erase ^?
Neither work,...
Thanks. I keep refreshing this thread to get the answer.
No I ssh from a linux box as well. In this one it works.
Yes. my Delete is fine.
BTW, the problematic machine is a Linux server that I connect to by ssh.