825 Posted Topics

Member Avatar for Edwins_1
Member Avatar for magdaekeya
1
223
Member Avatar for psmb

There are plenty of freely available priority queue implementations. What is that they do not provide for you?

Member Avatar for mike_2000_17
0
194
Member Avatar for andruluchko

You'll need to find two things: maximum line length and the number of tokens on each line. One you have those, the algorithm might looks something like: for each line: if line.length == largest: print line else: extra_spaces = largest - line.length for token in line and extra_spaces > 0: …

Member Avatar for L7Sqr
0
182
Member Avatar for Daniel_30

There are many such resources that already exist, what unique properties will yours bring to the table?

Member Avatar for Daniel_30
0
111
Member Avatar for Ghost0s

The device doesn't care. The device handles frames (google for **Ethernet protocol**) which have mechanisms for synchronisation and consistency. A device is simply handed a frame (from some upper layer protocol, for example) and sends that frame out. On the receiving side, that frame is received and handed up (to …

Member Avatar for taichichuan
-1
181
Member Avatar for myk45

What **Moschops** suggests is correct. However, there are other things that may complicate the process. There is an environment variable (`LD_PRELOAD`) that allows you to change the order of loaded libraries of a compiled executable. In addition to that, your codebase may change the definition of a function via `#define` …

Member Avatar for L7Sqr
0
152
Member Avatar for Joshua_9

Outputting exactly that is an easy exercize - simply execute a number of `std::cout` statements. I think what you mean to ask is how to do the following: * Read a value (as an integral value) * Read that many more values (as integral or floating point) * Compute functions …

Member Avatar for David W
0
541
Member Avatar for kyle.mace.35

You can not write to either of `param1` or `param2` without pointing them at valid memory. When you create a raw pointer (i.e. `char *`) it most likely does not point to some place you should (or can) write to. Try something like: char param1[SIZE] = {0}, param2[SIZE] = {0}; …

Member Avatar for rubberman
0
1K
Member Avatar for kyle.mace.35

You may also look into the `popen` call. `popen` allows you to spawn a process and communicate with that process without all of the bookkeeping of the `fork`, `exec`, and `pipe` calls.

Member Avatar for rubberman
0
2K
Member Avatar for Ghost0s

Wireless and cables are PHYsical components. They deal with transferring bits directly; there is a specific process for each medium. The networking stack itself is made of layers (PHY, LINK, NET, TRANSPORT, APPLICATION in the TCP/IP model). Each layer is responsible for managing its own view of a connection. In …

Member Avatar for L7Sqr
0
187
Member Avatar for Sadiiiiiiiiee

My approach would be to tell the instructor that this is a poor example of an assignment. If you are learning something other than arrays then perhaps this makes sense (but I am still skeptical). Otherwise an arbitrary restriction on the use of arrays (which is the appropriate way to …

Member Avatar for cgeier
0
227
Member Avatar for ayfa.selina

What are you interested in? What are you good at? Are you looking to lead a team to do this or develop things on your own? There are many questions you have not answered that we need to help guide our responses.

Member Avatar for DonnSchwartz
0
210
Member Avatar for RikTelner

What are you looking to get out of an OS? Visual distinction? Try any number of window managers: fluxbox, xfce, enlightenment... Better yet, try going *without* a window manager ;) I like to think of my OS as a tool: the more it works for me; the better the tool. …

Member Avatar for mike_2000_17
0
1K
Member Avatar for CashFlowsToo

Ruby is a language. It is very much like other scripting languages such as Perl and Python. There is nothing that makes Ruby any more special than other similar languages: it is more of a personal preference (style) thing. For me, Perl is a write-only language and I don't like …

Member Avatar for L7Sqr
0
298
Member Avatar for lewashby

> severely damages the distribution of random numbers @deceptikon, is that still the case on most modern implementations? As I understand it, it is now more a function of the modulo divisor and the number of times you want to get a random sample. High modulo divisor with low number …

Member Avatar for deceptikon
0
216
Member Avatar for yeyo_1

To add to what **pritaeas** mentions, while it is not the most frequented area there are members who regularly check here (including myself).

Member Avatar for yeyo_1
0
379
Member Avatar for blue30

Do you know what AODV does? What aspect do you wish to improve? As far as `ns2`, I'd suggest you first move to `ns3`. It is much improved over its predecesor. In `ns3` `.tcl` represents a motion input; a description of how nodes move over time you will need to …

Member Avatar for L7Sqr
0
76
Member Avatar for ankit.4aug

[icode]*--*++cpp+3[/icode] [icode]cpp[-1][-1]+1[/icode] I challenge you to find a place where either of these are even remotely necessary.

Member Avatar for Suchita_1
0
141
Member Avatar for blue30

May I also suggest that you move on to `ns3` while you are at it. For most tasks, `ns3` is far superior to `ns2`. If you are moving in the direction of Linux then it makes the transition to `ns3` even easier as the installation is essentially spelled out for …

Member Avatar for L7Sqr
0
132
Member Avatar for samsudin

Monitoring the computer itself is one thing - you should probably expect you are being monitored if you are at work; it is an increasingly common practice among employers. However, knowing if someone is watching your online activity (data sent to/from your computer) is impossible to tell from your local …

Member Avatar for melissad
0
592
Member Avatar for Joemeister

I've been witnessing your threads evolving as you develop your calculator application over time. You are at the point now that you are wanting to introduce the equivalent of function calls within your input. This has now become, for all intents and purposes, a domain specific language (DSL). You may …

Member Avatar for マーズ maazu
0
920
Member Avatar for Joemeister

You never update the `found` variable so multiple instances will not be modified. Here is an example that does what I expect you want: #include <iostream> #include <string> int main () { const std::string fname = "sqrt"; const size_t len = fname.size (); std::string expr = "sqrt(81) + 14 * …

Member Avatar for L7Sqr
0
198
Member Avatar for amithunter

Threads is one option; another is to use timers. It really depends on what you are trying to validate. Are you looking to drive control of the game or just report the system time while the game is being played?

Member Avatar for L7Sqr
0
95
Member Avatar for Jack_9

The phrase *bring it on* presents like a taunt. Not many people will reply seriously to such comments. If you want to debate the properties between two languages it is helpful to define a context. Some examples: * When doing rapid web prototyping what are the advantages of using either …

Member Avatar for OrionBlastar
-2
529
Member Avatar for nravhad
Member Avatar for Kris_3

You may have come from a language like `Python` where whitespace and indentation have a particular meaning for scope. In `C++` scope is handled a little different; you wrap the bodies of `if`, `else`, `while`, `for`, and other control structures in `{` and `}`. (You did this for both your …

Member Avatar for mike_2000_17
0
204
Member Avatar for amithunter

C files are not executable; you need to *compile* them to executable code. Integrating with a boot process involves system-specific components. You have not provided any system details. What exactly do you need this functionality for?

Member Avatar for amithunter
0
167
Member Avatar for Jjajangmyeon

If you absolutely can not not touch that file you can just place the namespace declaration prior to including the file. For example: unsing namespace std; #include "Date.h" However, I think you should approach your professor with the issue at hand and show that he/she *should* be using namespace resolution …

Member Avatar for David W
0
237
Member Avatar for Joemeister

I wrote a code snippet (in C++) not too long ago for doing just this. You can find it [here](http://www.daniweb.com/software-development/cpp/code/427500/calculator-using-shunting-yard-algorithm)

Member Avatar for iamthwee
0
605
Member Avatar for fmchua

In C, an `if`/`else` statement looks like this: if (condition 1) { /* Do condition 1 stuff */ } else if (condition 2) { /* Do condition 2 stuff */ } else { /* do default stuff */ } All you need to do is place your logic into that …

Member Avatar for David W
0
103
Member Avatar for Joemeister

You have a few options. You can return a format string of sorts where the string is encoded with meta information that allows you to assign values in a transformation. Think of how `printf` format strings work but with labels. For example: `expr_string = ":a + ( 2 + 2 …

Member Avatar for L7Sqr
0
166
Member Avatar for nhrnjic6

Usually, developers will maintain their library (or component) code in a source/header structure. In your case it would be the header files and source for the `Queue` you have built. Yours may be header-only, but I'll assume that there are also source files. If your design is proper, you should …

Member Avatar for Schol-R-LEA
0
236
Member Avatar for SoreComet

`==` for character array (`char*`, actually) compares the pointers themselves. If the two pointers are not pointing at the exact same memory location the results will be false. If you want to compare the strings themselves (the individual character-by-character comparison) you will want to use something like `strcmp`.

Member Avatar for SoreComet
0
123
Member Avatar for kimlong008

If you have Visual Studio available why not just use that to build your binary directly? [edit] I did not see that you were using a GNU library. Are you able to build the exe by hand on the command line? Does that not provide a portable binary?

Member Avatar for kimlong008
0
313
Member Avatar for nhrnjic6

Do you want to return an result from the function that indicates whether to stop or do you want to divert local control flow *from within a function call*? The former is entirely possible. The latter would require tricks and be non-portable.

Member Avatar for Xecantur
0
145
Member Avatar for Asma_2

To reiterate what **Hiroshe** mentions, there is a wealth of information available on this topic in the literature (try google scholar if you do not have access to university resources directly). I imagine you will find some paper that references an open source (probably half-complete) version of their code written …

Member Avatar for L7Sqr
0
277
Member Avatar for Deep Modi

This is a touchy subject and you chould check with forum guidlines before you cross the posted rules. FYI *cracking* is generally looked upon as a negative activity while *hacking* is a quest to understand the operation of things (depending on your interpretation). If you are interested in how to …

Member Avatar for Deep Modi
0
272
Member Avatar for davecoventry

Why not use a `std::list< std::string >` to do this? `std::string` has an `operator==` which you can use. Depending on the situation you could use **NathanOliver**'s solution. However, that requires you to know the entire set of commands at compile time. This may or may not be the case for …

Member Avatar for NathanOliver
0
304
Member Avatar for muhammadse03503

`strtol` is very flexible this way. You can give it a pointer to a string, a pointer to a string that will point to the last converted chartacter + 1, and a base to use in the conversion. Using the second argument you can verify that some number of digits …

Member Avatar for L7Sqr
0
124
Member Avatar for thunder234

That really depends on what error messages you are getting. Have you tried to address the cause of the specific errors?

Member Avatar for zzmrzz
0
323
Member Avatar for finders
Member Avatar for L7Sqr
0
94
Member Avatar for nathan.pavlovsky

What types were provided with the error? That is usually a good place to start looking. `operator=` is not defined for some pair of operands you are providing.

Member Avatar for nathan.pavlovsky
0
2K
Member Avatar for Fazelessmetal

`cin >> x` already grabs the input you provide. The second call (`getline(cin, x)`) attempts to do the same thing. That is why when you provide a second input you get output of the second token.

Member Avatar for NathanOliver
0
350
Member Avatar for london-G

You can disable TCP timestamp on the host machine; no need to disable it on the router. Depending on your OS just google how to disable TCP timestamp for that platform.

Member Avatar for L7Sqr
0
257
Member Avatar for EarhawkPH

You have a semicolon after your `if` statement which terminates the statement. Try: if (A > B) { printf ("%d is Higher\n", A); } else if (B > A) { printf ("%d is Higher\n", B); }

Member Avatar for deceptikon
0
188
Member Avatar for nitin1

When compilation happens functions are transformed to binary and are given a well-known location in the file so that other functions may jump to them by name. Each file (compilation unit) is compiled seperately so if you provide a definition elsewhere (in another source file) you have to tell the …

Member Avatar for L7Sqr
0
136
Member Avatar for L7Sqr

Often times it is useful to instrument a program you do not have the source to in an attempt to learn more about it. This can be for debugging purposes, blackbox testing, or for providing alternate versions of common functions/libraries (to name a few). On Linux, there is a very …

2
1K
Member Avatar for archie.herbias

At a minimum, a command interpreter does the following three things: 1. Display a prompt 2. Read a line of input 3. Loop to #1 A *functional* command interpreter adds a new step that executes the command read during step #2 and before looping back to step #1. I `C`, …

Member Avatar for archie.herbias
0
2K
Member Avatar for Abeeha sheikh

Without source code it is very difficult to know. Please post a short sample of your program, a description of what you expect to be happening and what *is* happening and we will be better equipped to help you out.

Member Avatar for Ancient Dragon
0
147
Member Avatar for Jjajangmyeon

`while(choice != 1 || choice != 2 || choice != 3)` is always true regardless of your input. The `||` operator will chain the operands and return true if *any* of them are true. Because `choice` can never be three values at once this statement will never be `false` and …

Member Avatar for Jjajangmyeon
0
175

The End.