2,898 Posted Topics

Member Avatar for nitin1

> but i never say anyone about my awesome and fabulous source is. ;) You are reaping the benefits of a community of people who find that it is important to share knowledge and help others to improve, and are generous enough to take the time to do so. Then …

Member Avatar for nitin1
3
212
Member Avatar for nitin1

> is it like vacancies which comes ? like in a big big companies vacancies comes around , is that like this ? Not really like that, since moderation is mostly voluntary. But yeah, it's basically that the number of mods becomes too few. Some mods may stop being active …

Member Avatar for nitin1
0
245
Member Avatar for sachinT

I guess you can get books on Linux networking and system administation. Like: For a free reference on system administration: [Linux Network Administrator's Guide](http://oreilly.com/openbook/linag2/book/index.html) (free online) For a more all-around guide to Red Hat (one of the most popular distro for servers): "A Practical Guide to Red Hat Linux" - …

Member Avatar for mike_2000_17
0
195
Member Avatar for tvm78

In the code you posted, the only error I can spot is this bit: return temp->value; //Returns the value of the top node. delete temp; //Deletes the top node in the stack. You can't have a statement after the return statement. That statement will never execute. You need to do: …

Member Avatar for mike_2000_17
0
357
Member Avatar for Vasthor

@AD: That's a screen shot of msys, the MinGW replacement from cmd.exe (command prompt). It is a unix-like bash shell for Windows, like cygwin. That's the standard way to run MinGW/GCC in command-line (unless you want to suffer and use the command prompt). @Vastor: The problem I see on the …

Member Avatar for mike_2000_17
0
159
Member Avatar for theguitarist

> while const int may not even be given storage because the compiler may just treat it as if it were a macro by inserting its value wherever it is used. No, it can't be treated as a macro (substituting for a literal constant), because the const-variable must have an …

Member Avatar for mike_2000_17
0
6K
Member Avatar for VernonDozier

Let's have a look at the C++ Standard, shall we: Section 17.6.4.3.2/1: > Certain sets of names and function signatures are always reserved to the implementation: > — Each name that contains a double underscore _ _ or begins with an underscore followed by an uppercase letter (2.12) is reserved …

Member Avatar for VernonDozier
0
788
Member Avatar for mke48

The parameter `pGTPrice` is a pointer-to-member-function. And to call the member function it points too, you need to supply an object on which to call it. Within the "GetStars" function, you should use the "this" pointer to address the object you want to call the member function on, you can …

Member Avatar for jacob.lemelincarrier
0
3K
Member Avatar for firdousahmad

The only real difference between a `struct` and a `class` is in the default inheritance and access rights. Given a base-class `B`, you could write: class C : B { // inherits B privately, by default, same as ': private B {'. void foo(); // private member function, same as …

Member Avatar for mike_2000_17
0
142
Member Avatar for sss93

As AD said, there are [many alternatives](http://en.wikipedia.org/wiki/List_of_platform-independent_GUI_libraries). Doing Win32 API directly is probably the worst option. In a similar style as doing Win32 API directly, you can use [SDL](http://www.libsdl.org/), which is at least cross-platform and a bit easier, but still very basic and low-level like Win32 API. On the Microsoft …

Member Avatar for mike_2000_17
0
386
Member Avatar for triumphost

> Why can't we do this in C++? The compiler says it's ambiguous or that the parameter x shadows a member of such and such class. > Is there any tricks to doing this? The `this` pointer exists in C++ too (Java copied this feature from C++). You can access …

Member Avatar for mike_2000_17
0
493
Member Avatar for daino

Most programming languages and some scripting/interpreted languages have the capability of calling C functions in a DLL or .so file (i.e., a shared library). This is what usually serves as the glue between any two language, and is most often the basis for other frameworks geared towards inter-language interfaces (like …

Member Avatar for daino
0
208
Member Avatar for Suzie999

> Main part of my project is to capture and parse all incoming and outgoing network > traffic on the fly. Do you think that merits a performance concern? Not until you have tested your program and realize that your code is not able to keep up with the data …

Member Avatar for vijayan121
0
257
Member Avatar for nitin1

That forum is called "Software Development" -> "Computer Science". That is where you post language-agnostic problems, such as discussions on algorithms and approaches to solve a problem.

Member Avatar for nitin1
0
165
Member Avatar for iEpic

What about a while loop? Something like this: boolean shouldContinue = true; while(shouldContinue) { shouldContinue = false; input = JOptionPane.showInputDialog("Enter a number between 1 and 10 " + "and I will convert it to a Roman numeral: "); num = Integer.parseInt(input); if (num == 1) JOptionPane.showMessageDialog(null, "I"); else if (num …

Member Avatar for JamesCherrill
0
218
Member Avatar for Geli19

The seeding really only needs to occur once in the entire program (at the start). You don't need and shouldn't re-seed in the constructor of that object. Just call the seed once at the start of the main() function, and that's it. Try it, it will work as you want …

Member Avatar for Geli19
0
5K
Member Avatar for silvercats

> I am expecting an answer from an kind of a expert who have read multiple books . The main problem with this is that you don't become an expert by reading books after books on C++ (I think I have maybe read, partially, about 3-4 books on C++, and …

Member Avatar for arkoenig
0
355
Member Avatar for Sasquadge

If you want to compute complex numbers, then you should use the `<complex>` header and use the `std::complex<double>` type to represent your numbers. However, if you want to avoid it (why?), then you can simply check the value inside the square-root to see if it is negative (thus, leading to …

Member Avatar for rubberman
0
3K
Member Avatar for green_ning

> xcode is for MAC, not MS-Windows. I believe the OP is asking about a cross-compilation environment, such that you can develop code for the iOS under a MS-Windows-based development environment. Personally, I know nothing about doing this, but I just wanted to clarify.

Member Avatar for green_ning
0
273
Member Avatar for Tinnin

You have a circular dependency problem. "Container.h" includes "Student_info.h" which includes "Container.h" which includes "Student_info.h" ... In terms of your declarations, you shouldn't need that. In other words, you shouldn't need to include "Container.h" in the "Student_info.h" file. Remove that include statement and your problem should be solved.

Member Avatar for NathanOliver
0
233
Member Avatar for I_m_rude

> Just share that what have you all done in your universities/scholl time which made you to come to this level of programming. For programming, the University / School part was mostly irrelevant, I only ever took a few programming courses and they were all compulsory courses (as part of …

Member Avatar for nitin1
3
295
Member Avatar for resmi sanker

It is basically what the lay-person would call Artificial Intelligence. This comes out of the general realization that the key aspect of an intelligent system is its ability to learn, i.e., to adapt and restructure its computational resources to gear them towards solving problems it commonly encounters (is trained to …

Member Avatar for mike_2000_17
-1
226
Member Avatar for riccardo-m

MyOtherClass myClass; The above declares an *object* of class `MyOtherClass`. myClass.MyFunction(); The above calls a member function called `MyFunction()` on the *object* called `myClass`. MyOtherClass *myClass; The above declares a *pointer* to an object of class `MyOtherClass`. In other words, the pointer can store the address in memory of an …

Member Avatar for riccardo-m
0
258
Member Avatar for mcgarcia
Member Avatar for trantran

To your original question: > Is it possible to 1) count 2) extract types in/from a typelist using variadic templates. The easiest thing is to put the list of template arguments into a tuple type and then extract the count and elements. As so: template <typename... Args> struct info_on_types { …

Member Avatar for trantran
0
764
Member Avatar for muhammads

> Do i have to write two totally different codes for different enviroments. If you stick to only standard libraries (I mean, the [C++ standard libraries](http://www.cplusplus.com/reference/)) and to standard C++, then all you have to do is recompile it for both environments. That's easier said than done for non-trivial codes, …

Member Avatar for rubberman
0
206
Member Avatar for Jsplinter

> Hard coded time = 125ms > PreCalced Array time = 130ms > PreCalced Vector time = 624ms > Repetitive Calc time = 5444ms... First observation, from your code, my first thought was: the compiler will optimize away the entire calculation part of the hard-coded loop. And that's gonna happen …

Member Avatar for Jsplinter
0
269
Member Avatar for MasterHacker110

Like [Wireshark](http://www.wireshark.org/). It's an open-source project, so feel free to check out its source code and learn from it.

Member Avatar for L7Sqr
0
222
Member Avatar for WolfShield

It's probably borrowed from the chain-smoking poet or whiskey-drinking writer stereotype. Btw, I'm a programmer, a smoker, and a whiskey drinker, so I guess I qualify.

Member Avatar for BitBlt
0
250
Member Avatar for soapy.thomas

cin (and other istreams) is a bit complicated to grasp at first, but here's the basic information you need to know: cin is a buffer of data that accumulates whatever the user inputs, which it can then feed by various "extraction" methods. So, when the user writes something and then …

Member Avatar for m4ster_r0shi
0
400
Member Avatar for daino

Most GUI tools will hide away the main() function, because you don't have to temper with it, shouldn't need to, and probably shouldn't, period. But if you want to know what it looks like or what it does, out of curiosity, I can tell you. Typically, a GUI application is …

Member Avatar for daino
0
261
Member Avatar for vinnitro

You have to use Windows' partition manager and locate the linux partitions (they should appear as having unknown format, and there should be at least two of them (root and swap) and possibly a third one (/home)). Then, you "delete" those partitions which will create some "free" space on the …

Member Avatar for JorgeM
0
195
Member Avatar for jkon

This sounds like a good idea. I'm not sure if there is something similar already. Just a thought. This sounds very similar to YouTube's "suggestions" column, but for website links (URLs) instead of videos. What I mean is that this list of suggested "related" videos is most likely created from …

Member Avatar for pritaeas
0
224
Member Avatar for ChaseRLewis

1) Return-value-optimization (RVO): The situation you describe is one of the basic applications of return-value-optimization. This is a classic optimization, permitted by C++, and implemented by all decent C++ compilers that I know of. You can check the assembly listings generated by your compiler for the given code to see …

Member Avatar for mike_2000_17
0
165
Member Avatar for daino

Please define what you mean by "report generator". Or do you mean documentation generator, like [doxygen](http://www.stack.nl/~dimitri/doxygen/)?

Member Avatar for daino
0
158
Member Avatar for coolikedat99

It appears you just don't have gcc installed (code-blocks or geany or kdevelop will not install the compiler, they are only IDEs). Run this command: $ sudo apt-get install build-essential

Member Avatar for np complete
0
233
Member Avatar for myk45

Statically linking the libraries into the executable is not a problem at all. However, you have to be careful about a few things. First of all, if you have an external library that provides a DLL and an import library (.lib on Microsoft compilers, and .a on others) then you …

Member Avatar for myk45
0
316
Member Avatar for atch

> Does anyone know what his formal education is? Does it really matter? Whatever he studied, it's probably obsolete today. His accomplishments are stupendous and his technical knowledge of C++ and programming in general can be matched by only a handful of people in the world. This completely dwarfs whatever …

Member Avatar for atch
0
232
Member Avatar for claywin

You would probably be better off using an off-the-shelf library for that, like the [Open Dynamics Engine (ODE)](http://www.ode.org/). It's a simple but pretty solid engine for doing computer game physics realism (not for real simulations, of course). The basic idea with this is that you control your objects (characters, vehicles, …

Member Avatar for mike_2000_17
0
215
Member Avatar for leokin

Sure, there is always room. Welcome! For Linux-specific questions, there is a "Hardware & Software" -> "Linux and Unix" forum. Glad to hear you managed to unplug from the MS/Apple "Matrix".

Member Avatar for sbesch
0
444
Member Avatar for misi

In C++, you need to do the cast explicitly: static unsigned char row[4]; static unsigned short *p1 = reinterpret_cast<unsigned short *>(&row[0]); static unsigned short *p2 = reinterpret_cast<unsigned short *>(&row[2]); static unsigned long *long_random = reinterpret_cast<unsigned long *>(&row[0]); That should solve your problem.

Member Avatar for misi
1
241
Member Avatar for DeVTeo
Member Avatar for triumphost

The problem is that your function overload: template<typename T> void MemDeSerialize(T*& Destination, unsigned char* &Source, size_t Size){...} takes a *reference* to a pointer. And because you call it with `&Destination[I]`, which creates a pointer to the Ith element, that pointer is a temporary object, and it cannot be bound to …

Member Avatar for mike_2000_17
0
186
Member Avatar for hypernova

The demand for good programmers is high, and is not likely to diminish anytime soon. The saying goes: "Good programmers don't starve." For example, I'm subscribed to some C++ developer groups on LinkedIn, and there are between 10-20 new job postings everyday, just for C++ programmers. Overall, salaries seem comparable …

Member Avatar for danieljacob344
0
327
Member Avatar for dot_binary

The "delay" function is called `Sleep()` and you can get it through the `<windows.h>` header. The Sleep function sleeps for the specified number of milliseconds. However, do not expect good precision, thread-switching frequency in Windows is notoriously slow and unresponsive, don't expect precision higher than about 10ms to 30ms. The …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for SimonFrance

I personally prefer KDE. It is nice, polished and highly customizable (based on Qt). And the default configuration is very Windows-like, so it will be easy to adopt if that is where you are coming from. You can get KDE-packaged Linux distributions mainly as [Kubuntu](http://www.kubuntu.org/) (based on Ubuntu), [Fedora KDE …

Member Avatar for JasonHippy
0
153
Member Avatar for TrustyTony

Of course, my C++-brain cringes at the sight of all the blantant inefficiencies in the code, but if I adopt the Python mindset, then your code snippet is quite nice! Lots of demonstrations of Python-kung-fu in there. A few comments: I think you are not protective enough of your invariants, …

Member Avatar for TrustyTony
1
1K
Member Avatar for LastMitch

For the first thread, in Community Feedback, I believe it is normal as posts under the Community Center forums do not receive rep-points, that's just the policy. As for the second thread, I don't know why it didn't cause rep-points to the member. I have noticed something similar if you …

Member Avatar for LastMitch
0
175
Member Avatar for Dani

I assume there is also an untold gentlemen's agreement that you don't vote for your own snippet if you have one in there.

Member Avatar for TrustyTony
1
460
Member Avatar for triumphost

First of all, you should not use template specialization of function templates. [Here](http://www.gotw.ca/publications/mill17.htm) is an explanation why. You must use overloading instead. So, your "Model" Serialize function should just be a straight overload: void Serialize(unsigned char* &Destination, const Model& M) { Serialize(Destination, M.SX); Serialize(Destination, M.SY); Serialize(Destination, M.Stride); Serialize(Destination, M.ID); Serialize(Destination, …

Member Avatar for triumphost
0
106

The End.