1,359 Posted Topics

Member Avatar for tazeen_muzammil

Actually, the simplest solution is to use a `static` local variable: int call_counter() { static int count = 0; return ++count; }

Member Avatar for Schol-R-LEA
0
332
Member Avatar for sushants

Conceptually, a [string](http://en.wikipedia.org/wiki/String_(computer_science)) is an object that holds a piece of written text. The name 'string' is historical, and refers to the concept of ['string rewriting'](http://en.wikipedia.org/wiki/Semi-Thue_system), a mathematical technique for analyzing sentences in an abstract grammar; the intended mental image is of pieces of paper held together by a (physical) …

Member Avatar for JamesCherrill
-4
225
Member Avatar for MasterHacker110

Unfortunately, Moschops is right. Assembly language by its very nature isn't particularly friendly, and x86 assembly specifically is rather gruesome. The best you can really do is get a good IDE such as [RadASM](http://radasm.cherrytree.at/radasm/), [WinAsm](http://www.winasm.net/), [AsmEdit](https://sourceforge.net/projects/assemblyedit/) or [EasyCode](http://www.easycode.cat/English/index.htm), which lessens the severity of it somewhat. For the sort of work …

Member Avatar for pbj.codez
0
380
Member Avatar for Start4me

ALso, the reason there is no `main()` method is simple: the program is written as an applet (a web-based program meant to be run in a browser) rather than a stand-alone application - something you would know if you were the original author of the program. I am assuming you …

Member Avatar for Start4me
0
356
Member Avatar for KatJ9

As an aside, I noticed that you have posted to both here ande [DevShed](http://forums.devshed.com/python-programming-11/python-loop-problem-946257.html) with the same problem. FYI, cross-posting is generally frowned upon, as it leads to duplication of effort. You should only post to one forum at a time, and only re-post elsewhere if you think you have …

Member Avatar for KatJ9
0
480
Member Avatar for karan.rks

OK, since you don't mention what operating system you are running under, I will have to assume you are using Windows, though the answer for Linux and MacOS are more or less the same anyway. With Windows, the only Java compiler of importance is the one from Oracle themselves; under …

Member Avatar for stultuske
0
198
Member Avatar for general2012

As an aside: given that you are always allocating the same amount of memory for each of the arrays, and you never `free()` them, is it really necessary to use dynamic allocation for the arrays? What I mean is, with the code as it is now, you could just as …

Member Avatar for general2012
0
249
Member Avatar for nitin1

A minor point unrelated to the question: the `cout` object and it's selectors only found in C++, not C.

Member Avatar for Banfa
0
120
Member Avatar for njoguj
Member Avatar for new_developer
0
116
Member Avatar for Himanshu Chawla

There are a number of problems with this code, but the most important is that there is a syntax error in the increment part of the inner `for()` loop. for(j=65;j<=i;j++;count++) As things stand, this code shouldn't compile; the third semi-colon should be just a comma. for(j=65;j<=i;j++,count++) This isn't the cause …

Member Avatar for Schol-R-LEA
-1
198
Member Avatar for dendenny01

A few notes: * You should always declare the `main()` function as type `int`, and return a value at the end of it. While some compilers do allow you to declare `void main()`, it is non-standard and non-portable. Don't do it. * The `<conio.h>` header and the functions it declares …

Member Avatar for Schol-R-LEA
0
221
Member Avatar for pearl doll

Finding a number's cube is simply a matter of multiplying it by itself three times: double cube(double x) { return x * x * x; } Are you sure you didn't mean the [cube root](https://duckduckgo.com/?q=newton%27s+method+cube+root)?

Member Avatar for ddanbe
0
145
Member Avatar for ajike

**ajike**: Are you certain that the box you are trying to connect to has a telnet server running, and that port 23 isn't being blocked by the firewall on either system? Most system installations disable telnet by default these days, because of security concerns.

Member Avatar for Schol-R-LEA
0
4K
Member Avatar for salomonsk8

One piece of advice I can give is that, whenever you find yourself using several variables of the form name*N*, consider refactoring them as an array or an `ArrayList`. The `hang0`, `hang1`, `hang2`,... `hang10` variables in particular stand out as something where a number of things would be simplified if …

Member Avatar for salomonsk8
0
517
Member Avatar for willjohanz

It's even better than that, actually; it is clear that the OP didn't even transcribe the questions correctly, as most of them are clearly incomplete.

Member Avatar for stultuske
-3
155
Member Avatar for willjohanz

Given the sort of questions these are, there isn't much advice we can give that wouldn't constitute answering the questions.

Member Avatar for JamesCherrill
-1
175
Member Avatar for toniann.midori

The reason it isn't working is because the condition in the `if:` statement is incorrect. When you write if first == "a" or "e" or "i" or "o" or "u": ... what it is really saying is if (first == "a") or ("e") or ("i") or ("o") or ("u"): That …

Member Avatar for vegaseat
0
158
Member Avatar for napninjanx

With suitable libraries to draw on, you can write most types of programs in Python, except for really low-level systems work (device drivers and so forth). The biggest disadvantage over C isn't in what you can or cannot do with it, so much as how fast the program is likely …

Member Avatar for vegaseat
0
180
Member Avatar for Cwww

Would you please post what you've done so far? Without being able to see the code, it would be difficult if not impossible to give you any advice.

Member Avatar for Cwww
0
278
Member Avatar for Briki

Just how you would do that would depend on the compiler, and possibly on the development environment you are using as well. Do you have a compiler chosen already, or are you looking to get one? If you have a compiler already, do you have an editor or Integrated Development …

Member Avatar for Schol-R-LEA
0
127
Member Avatar for sujanthi.kumari

In what way isn't it working? Does it fail to compile? Do you get any error or warning messages? Does it run and crash? Does it give the wrong values? We really need more details in your initial post in order to help you. BTW, two things you should know. …

Member Avatar for new_developer
0
182
Member Avatar for napninjanx

Well, for a design document, I suppose it's a start. You would need a *lot* more detail, however, even before you could consider writing any actual code. If your actual goal is to write a photo editing program, well, that's about as complex as any project you could have chosen. …

Member Avatar for Schol-R-LEA
0
322
Member Avatar for Doze_4u

I'm afraid we'll need more information than just the assignment statement. Is there anything in particular that confuses you? * Do you know how to use multiple source and header files? * Do you know what a pointer is, and how to use one? * Do you know how to …

Member Avatar for joshua.klaser
0
351
Member Avatar for jtjudge

OK, I'm puzzled about that myself, but not for the same reason. At this point in the function, the variable `temperaturef` doesn't have any set value, which means it should be giving a `NameError` exception instead, like this: NameError: name 'temperaturef' is not defined Instead, it is acting as if …

Member Avatar for jtjudge
0
216
Member Avatar for MasterHacker110

Well, the good news is, a certain number of C++0x/C++11 features did make it into VS2010 and VS2012; the bas news is, constexprs weren't among them. A detailed explanation of which features are and aren't supported can be found [here](http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx). This leaves you with the prospect of using a different …

Member Avatar for MasterHacker110
0
350
Member Avatar for soche123

Well, what you have to understand is that the braces aren't directly connected with the loop or conditional, *per se*; in fact, the control structures are actually defined as to accept the *one* statement immediately following the conditional. In [EBNF](https://duckduckgo.com/?q=extended+Backus-Naur+Form), it would be defined as: <if-statement> ::= 'if' '(' <conditional> …

Member Avatar for Captain119
0
115
Member Avatar for silentdragoon

First off, in the future, when asking a question, please post a new thread of your own rather than resurrecting one from five years ago. Second off, the real question here is, what sort of hash function should you use? The fairly simple approach you mention (taking the modulo of …

Member Avatar for arshdeepkaur
0
673
Member Avatar for soche123

Oh, I see. Oh dear me. OK, then, I will start with the `if()` statement, as it is the easier of the two to understand. Basically, what an `if()` statement does is take a true or false value, and based on that value, select from one of two paths to …

Member Avatar for new_developer
0
183
Member Avatar for Diaphanosoma

I would recommend starting with [BeautifulSoup](http://www.crummy.com/software/BeautifulSoup/), which is made for just such a purpose.

Member Avatar for Diaphanosoma
0
123
Member Avatar for sourabhyogi

I would, first off, recommend against using `scanf()` directly for this; since the input is by line, and of irregular size, I would instead read the data with `fgets()` and then apply `sscanf()` to the string after it has been read in. This should avoid the issue nicely, as you …

Member Avatar for sourabhyogi
0
269
Member Avatar for dp121307

Standard, no, but it is [freely available](http://cs1graphics.org/) and appears to be reasonably well documented. Unfortunately, I'm short on time right now, or else I would dig into it a bit deeper; as it is, I'll try to get back to it later tonight, if I have the opportunity (though I …

Member Avatar for bumsfeld
0
341
Member Avatar for aslam.junaid786

Part of the problem is that you are closing the output file inside the loop you are reading and writing in, which means you are no longer actually writing to the file after the first pass. But that's just the start of the problem. The problem is that you cannot …

Member Avatar for Schol-R-LEA
0
241
Member Avatar for Violet_82

It would depend on just what you are doing, but generally speaking, you would have them in separate files. Keep in mind that you can only have a single public class in a file.

Member Avatar for Violet_82
0
362
Member Avatar for nitish.mohiputlall

First off, we don't do other people's homework for them. Second, we *don't* do other people's homework for them. And third, ***we don't do other people's homework for them***. Sensing a pattern here yet? No one here will simply hand you a solution on a silver platter. If you show …

Member Avatar for ddanbe
-1
230
Member Avatar for Tsaou

I believe I see where the problem lies. The *local variable* `ylop` is defined in main.c, inside the `main()` function, as a regular `char` variable. The problem is that the functions are being selected using conditional compilation, which is performed by the pre-processor, not the compiler *per se*. The thing …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for DanDaMan

First off, I would say that this is different enough that you would have been better off creating a new thread, rather than posting in one several months old. Just for future reference. While I cannot say for certain without seeing the code, from the error message given it sounds …

Member Avatar for sanjila007
0
1K
Member Avatar for Necrozze

OK, perhaps we need to start over from scratch. What you need to understand is that an object is a model of something. It can be something real, like a car or a person, or something conceptual, like a list or a dictionary (I use those examples because, as it …

Member Avatar for Necrozze
0
304
Member Avatar for nurib

I would start by considering how the chat protocol to use, whether it is one you have designed yourself, or an existing one such as [XMPP](http://xmpp.org/). While an existing protocol is likely to be much more elaborate than one you've worked out yourself, it would have the advantage that most …

Member Avatar for Schol-R-LEA
0
333
Member Avatar for Kareem Klas

Technically, the `while()` loop is what is known as an 'indefinite iteration', which is to say that it repeats the body of the loop zero or more times, with the number of repetitions being unknown at the time the loop is begun. It repeats based on a condition which holds …

Member Avatar for Kareem Klas
0
334
Member Avatar for arba shahid

**usy1010:** First off, you should never hijack an existing thread with an unrelated question. It is better to start a thread of your own. More importantly, to both you and the OP, you have to understand that DaniWeb is ***NOT*** a free-homework-solving service. Simply posting a question as you both …

Member Avatar for Suzie999
-1
194
Member Avatar for maml

The answer to that is going to be entirely implementation-dependent, and the difference is probably negligible. Only by profiling can you get a definitive answer. The main cause of the difference probably will not be from the return per se, but from the need to pack and unpack the struct …

Member Avatar for annaharris
0
389
Member Avatar for Ismatus3

As PyTony points out, the code as given does *not* use the [`zipfile` module](http://docs.python.org/2/library/zipfile.html), but rather calls on a separate program named 'zip' to perform the file operations. That is both unnecessary and non-portable. This is how it would work using the `zipfile` module: import zipfile zip = zipfile.ZipFile(target, 'w') …

Member Avatar for woooee
0
313
Member Avatar for selipar.jepun.712

First off, you have to understand that no one here is going to write the program for you. This forum is for assisting programmers with projects, but we do not provide free homework solutions of the sort you seem to be looking for. In the forum rules, it states specifically: …

Member Avatar for Schol-R-LEA
0
144
Member Avatar for chrispitt

> If you need to store large values (above 32,767 or below -32,767), use long. Actually, this range only applies to 16-bit compilers such as Turbo C. Pretty much all modern C compilers for Windows, Linux and MacOS use a 32-bit `int`, in which case the range of values will …

Member Avatar for deceptikon
0
176
Member Avatar for melonhed85

First off, since you are manipulating them together, it may be a good idea to bundle the array and max together, along with the current size: struct people { struct person** data; int size, max; }; It is almost always better to separate the functions which manipulate data from the …

Member Avatar for Schol-R-LEA
0
3K
Member Avatar for entropic3105

You sholdn't need to; it is part of the standard Python library. I gather you were unable to use it? What version of Python are you using? What exactly happens if you enter the following into the Python interpreter prompt? import random random.randint(0, 6)

Member Avatar for entropic3105
0
759
Member Avatar for trebla21

The origina; post was from two months ago; it is safe to say that the 48 hour deadline has long since passed. :-p

Member Avatar for Schol-R-LEA
-2
226
Member Avatar for ferizhandi

First off, let's get this code suitably indented, so that it is readable: #include <stdio.h> int main() { write(1,"salam",5); char a[2]; char b[5]; read(0,a,2); if(a[0]=='8') { write(1,"ok",2); read(0,b,5); write(1,"ok2",3); } return 0; } I know that for newcomers, this may make it look like modernist poetry of some sort, and …

Member Avatar for Schol-R-LEA
0
170
Member Avatar for new_developer

The easiest solution for this is to use a `vector` of `vector`s and let the library do the heavy lifting, but I assume that that isn't available to you for this assignment. If that is the case, then I'll walk you through what you'd need to do here. Declaring the …

Member Avatar for deceptikon
0
245
Member Avatar for pbj.codez

Basically, you would need to call the interrupt twice, once for each string you are printing. SECTION .text global _start _start: mov eax, 4 ;sys_write mov ebx, 1 ;output to screen mov ecx, string ;creates address for my string variable mov edx, length ;creates address for my length variable int …

Member Avatar for Assembly Guy
0
211

The End.