a question about typedef syntax


, I think the syntax of typedef is typedef existing-type new-type However, I've seen a statement typedef string stringarray[42]; >From the programs that use stringarray, I can deduce it represents the type string[42]. If so, why is it not defined ...
Posted On: Monday 26th of November 2012 12:48:10 AM Total Views:  315
View Complete with Replies

RELATED TOPICS OF C Language PROGRAMMING LANGUAGE




question about atoi

The following description of atoi is pasted from cplusplus.com. My question is after the pasting. ***** PASTING BEGINS HERE ****** int atoi ( const char * str ); Convert string to integer Parses the C string str interpreting its ...
VIEWS ON THIS POST

131

Posted on:

Sunday 25th November 2012
View Replies!

Template and function pointer question

This is my first post here, please tell me if I did anything wrong. in the following code snippet: 1. template 2. In find_if(In begin, In end, Pred f) { 3. while (begin != end && ...
VIEWS ON THIS POST

129

Posted on:

Sunday 25th November 2012
View Replies!

A newbie's questions

Please pardon a newbie's innocent questions. 1) It seems a daft thing, but I can't handle << and >> easily in my mind unless I have a name for them. I've toyed with :- << Corporal and >> Captain (not ...
VIEWS ON THIS POST

130

Posted on:

Sunday 25th November 2012
View Replies!

template question: preallocation for the underlying deque in user-defined queue

Heck wrote: > I borrowed N. Josuttis's code for a queue ("The C++ Standard Library", > 1999, p. 450), with which he modifies the interface to read and > discard the front element on pop() and to throw an exception ...
VIEWS ON THIS POST

204

Posted on:

Sunday 25th November 2012
View Replies!

code improvement question

Consider the following piece of code. vector::iterator iter = find(unique_words.begin(), unique_words.end(), str); if (iter != unique_words.end()) iter->insert(cur_line_number); Can these three lines be combined Kindly reply
VIEWS ON THIS POST

98

Posted on:

Sunday 25th November 2012
View Replies!

keep splitting the atom question

I am writing a sampling type program which takes a buffer, and picks the middle of the buffer. But I need to take a bit out the middle and then take what is left (on both sides) and take ...
VIEWS ON THIS POST

96

Posted on:

Sunday 25th November 2012
View Replies!

Detailed logging question

I want to setup a macro to log informational strings if eg INFOLOGGING is defined. So I created a macro which outputs informational strings to a log file. I want to have a #define which switches this option on or ...
VIEWS ON THIS POST

82

Posted on:

Sunday 25th November 2012
View Replies!

C++ polymorphism question

, I was wondering, whether I can access members of a derived class from within it, if I accessed it from a virtual function on the base classpointer ^^ Example: class A { virtual void oskar(void); }; class B ...
VIEWS ON THIS POST

105

Posted on:

Sunday 25th November 2012
View Replies!

Job interview questions

Hi Guys, Recently I came across a blog which can be of great help to you and your friends to crack an interview.Its interview helper.Here is the link to interview helper http://interviewhelper.blogspot.com/ Hope this blog helps you in your job ...
VIEWS ON THIS POST

109

Posted on:

Sunday 25th November 2012
View Replies!

A question about multiple inheritance in C++!

In the following function: #include using namespace std; class V { public: V() {cout << "V()" << endl;}; V(int) {cout << "V(int)" << endl;}; }; class A: virtual V { public: A(){}; A(int){}; }; class B: virtual V { ...
VIEWS ON THIS POST

135

Posted on:

Sunday 25th November 2012
View Replies!

.cpp question

Ok, I know in Java we can seperate class files so that we could use them later on. I am wondering if I could do the same for C++... Perhaps have a main.cpp and lets say for example function.cpp... I ...
VIEWS ON THIS POST

117

Posted on:

Sunday 25th November 2012
View Replies!

Interview question.

Name two cases where you MUST use initialization list as opposed to assignment in constructors....
VIEWS ON THIS POST

105

Posted on:

Sunday 25th November 2012
View Replies!

2 basic questions about types and strings

, first of all I have a question about types: When I have a method like this... TYPE getStringValue() { string str = "test"; return str; } ....TYPE can't be "string" because "string" is no basic type. I made some ...
VIEWS ON THIS POST

135

Posted on:

Monday 26th November 2012
View Replies!

atexit problems and questions....

Hi all, This question relates to an earlier thread I started (static object as member of a class). I have the following (illustrative) code. Again, I hope to make no typos: class A { ... //whatever here }; class B ...
VIEWS ON THIS POST

151

Posted on:

Monday 26th November 2012
View Replies!

Basic question on streams

I understand that to creat a file output stream for example, I have to include and then: ofstream fout; which will create an object of type ofstream that I can use to interact with a file. My question concerns ...
VIEWS ON THIS POST

93

Posted on:

Monday 26th November 2012
View Replies!

Template member function specialization question

I have a (non-templated) class that has a templated member function. I wish to specialize this function in one particular case but run into a problem. I have put code below that shows this problem, if you un-comment the ...
VIEWS ON THIS POST

121

Posted on:

Monday 26th November 2012
View Replies!

Interview questions and answers

Interview questions and answers We have selected a big collections of interview questions and answers in many technical areas: Java, JSP, ASP, C++,C#,.NET,ORACLE, PL/ SQL,Perl, struts, XML....more ... http://www.techinterviewquestion.blogspot.com...
VIEWS ON THIS POST

111

Posted on:

Monday 26th November 2012
View Replies!

question on vector

Consider the following program: #include #include using namespace std; class Test { public: Test(); friend ostream &operator <<(ostream &os, const Test &t); private: static int counter; int value; }; int Test::counter = 0; Test::Test() { value = ++counter; ...
VIEWS ON THIS POST

99

Posted on:

Monday 26th November 2012
View Replies!

some casting questions

, It seems both static_cast and dynamic_cast can cast a base class pointer/reference to a derived class pointer/reference. If so, is there any difference between them In addition, if I have a derived class object and then upcast it to ...
VIEWS ON THIS POST

108

Posted on:

Monday 26th November 2012
View Replies!

Re: basic question about "clearing" a string....

Well, I think I can understand Avalon's rant. If someone were to answer with a smart-alec response that Bazarov did, I think I would be pi$$ed off too. A straightforward answer like what Herring said may have averted these quarrels... ...
VIEWS ON THIS POST

397

Posted on:

Monday 26th November 2012
View Replies!