3,183 Posted Topics

Member Avatar for iamthwee

Hover over an arrow to add a comment and reputation. Click the arrow just to vote. The arrow you click on or hover over determines if it's positive or negative. Aside from making a dummy dialog (which would ultimately be less user friendly as popups usually are) instead of splitting …

Member Avatar for Mike Askew
0
459
Member Avatar for clarisse.ibarra

> how can i make a program that will input a number and convert it into a word using array , and also not using string.h library? Technically you don't need either arrays or the string.h library to do this, though if you're accepting the word as a string it's …

Member Avatar for deceptikon
0
113
Member Avatar for kiwi101

Are you limited to a square matrix, or does the program need to support any MxN matrix size? The former is simple enough because the columns and rows match. The latter can be done with dynamic memory (the more general but harder option) or a "large enough" 2D array where …

Member Avatar for deceptikon
0
170
Member Avatar for wanderevil

It's basically a combination of how the X shoots and how the Y moves. You add a case to the switch for your shoot key to create a projectile, and then follow a similar algorithm as the bomb to manage the projectile.

Member Avatar for deceptikon
0
162
Member Avatar for Mike Askew

> Why don't you try using FireFox. Its fast and sleek. Patient: "Doctor, it hurts when I blink." Doctor: "Don't blink."

Member Avatar for Mike Askew
0
216
Member Avatar for FUTURECompEng

> Can someone please explain step by step on how I would figure this out. http://www.cs.duke.edu/~ola/ap/recurrence.html > "If" would be a simple n It would be constant since the running time doesn't grow with N in any way.

Member Avatar for FUTURECompEng
0
299
Member Avatar for HelloJarvis

dx9_programmer's answer is good, but I'd like to add just a couple of things. First, don't call strlen() in the condition of a loop because it's inherently inefficient. strlen() is a function that itself contains a loop, so when you say this: for (int i = 0; i < strlen(word); …

Member Avatar for HelloJarvis
0
1K
Member Avatar for cih1091

> According to me you should go for Linked Lists as suggested by Ancient Dragon. Its a good solution. Wouldn't that be according to Ancient Dragon then? ;)

Member Avatar for WaltP
0
116
Member Avatar for nitin1

> atleasy one must reply. Why? Replying to threads is strictly voluntary. Just because you *really* want an answer doesn't obligate anyone to provide one.

Member Avatar for mrnutty
0
161
Member Avatar for gotto
Member Avatar for gotto
0
397
Member Avatar for ilvanhellovan

The problem is that TSTR can be either `char` or `wchar_t`, so there's not really much choice beyond allocating an array of TCHAR and copying one into the other with a function that recognizes TCHAR and handles it accordingly: TCHAR *ttemp = new TCHAR[strlen(temp) + 1] _tcscpy(ttemp, temp);

Member Avatar for deceptikon
0
2K
Member Avatar for rithish

Here's a better example, see if it helps: #include <stdio.h> #include <stdlib.h> struct node { int data; struct node *next; }; int main(void) { struct node *head = NULL, *temp; int data; printf("Enter a number (0 to stop): "); fflush(stdout); while (scanf("%d", &data) == 1 && data != 0) { …

Member Avatar for deceptikon
0
254
Member Avatar for noahjer

> I'm just not sure how to see if they are equivalent based on the renumbering part.... If one number is shifted by a certain amount, all numbers will be shifted by the same amount. So when comparing the two arrays you can determine the shift amount by the very …

Member Avatar for deceptikon
0
114
Member Avatar for LukeJames

> What's up with that? Obviously Daniweb is so awesome that Microsoft decided to emulate us. :)

Member Avatar for JorgeM
0
229
Member Avatar for shawn.conway.77

> hm... tried that combonation and it didn't work. And how are you testing for a correct answer?

Member Avatar for logo32design
0
371
Member Avatar for silvercats

> I thought those places were real! Technically, nothing you use in programming exists because it's just text. ;) Even assemblers take a *text* file of assembly language which is then converted by an assembler into machine code.

Member Avatar for deceptikon
0
123
Member Avatar for romiaujla

`short` is a smaller integer type than int (conceptually, at least). The 0xAB00 part is a hexadecimal literal value with the bit pattern 1010101100000000. It's just another way of writing the decimal value 43776 that makes the bit pattern a little easier to see, assuming you're familiar with hexadecimal. ;) …

Member Avatar for nmaillet
0
193
Member Avatar for shanki himanshu

> when there are no comments even then i cant delete it? No. You can report it with the "Flag Bad Post" link and a reason stating why you want it deleted. Then a moderator will determine if the reason is...well, reasonable. But posts are typically only deleted based on …

Member Avatar for shanki himanshu
0
154
Member Avatar for somjit{}

> i dont get any output for case1 (ie char2shrt()) and case2 (ie int2shrt()).. any ideas on that? 'h' is a modifier to the %d specifier, you need them both: "%hd" > i do get an output for case 3 (ie shrt2int()), but have to work out in binary if …

Member Avatar for somjit{}
0
416
Member Avatar for linabeb

> if im doing a dll in dev c++ ..... > and doing a dll in c++ but using visual studio 2010 > > is both of them gonna be the same?? The two DLLs will be compatible, yes. So you can create a DLL with one compiler and load …

Member Avatar for linabeb
0
294
Member Avatar for hg_fs2002

> I need to bring an example of overwritten. Then you need to explain what you mean by "overwritten" more clearly. Because the way you've described it so far, an example that actually compiles is impossible.

Member Avatar for deceptikon
0
220
Member Avatar for cereal

That's weird. It's almost as if our code highlighter is interpreting tags with no content as empty tags. At least for that particular malformed situation (an extra closing tag that was probably added automatically by a "helpful" editor): <tag></tag> stuff stuff </tag>

Member Avatar for Dani
1
257
Member Avatar for porkchop7

Simultaneous processing can be done with threading, but that's a can of worms that I don't recommend opening unless you absolutely must. A way to fake it in a single threaded application would be to specify a distance threshold between the two keypresses that denotes "at the same time", and …

Member Avatar for Ancient Dragon
0
93
Member Avatar for WaltP

FYI: Dani and I typically use Area 51 for testing stuff in production so as to avoid cluttering the publicly viewable forums with such things.

Member Avatar for WaltP
1
239
Member Avatar for klharding2

Let's say `i` is 6. You're trying to take the factorial of `(2 * 6 + 1)`, or 13. 13! is 6227020800, which overflows even an unsigned 32-bit integer (your range is roughly halved from that by using a signed type). It's not unexpected that you'll start getting funky values …

Member Avatar for WaltP
0
92
Member Avatar for bobejoe

> can anyone tell me if there is such thing as 64 bit assembly Yes. > if so can you give me an assembler MASM, NASM, and FASM all support 64-bit instruction sets.

Member Avatar for mathematician
0
82
Member Avatar for omkar_hande

How are you creating the child process? The answer to this question depends on your OS and compiler because managing processes is highly dependent on the system.

Member Avatar for poornamoksha
0
284
Member Avatar for dasdsaasd

> What is the OP's question ? The OP's question was clearly "d". Can't you read? ;) Now we need to figure out what the question means and answer it. :rolleyes:

Member Avatar for WaltP
0
142
Member Avatar for nitin1

When working out these problems, start by understanding what the *expected* result should be, then trace through your code in a debugger and find the place where the expected result differs from the actual result. That's where your logic error is likely to be. Obviously this process can be difficult …

Member Avatar for deceptikon
0
133
Member Avatar for shanki himanshu

> where is union required? A union is never *required*, but it can simplify certain tasks such as type punning. An example is from the C standard library implementation in my signature. I use a union for punning between an IEEE double, its 64-bit representation, and a breakdown of the …

Member Avatar for deceptikon
0
129
Member Avatar for klharding2

You would do well with some error handling, as I suspect the file isn't being opened and span remains uninitialized: #include <cstdlib> #include <fstream> #include <iostream> #include <string> using namespace std; int main() { string filename; cout << "Enter a file path: "; getline(cin, filename); ifstream in(filename.c_str()); if (!in) perror("Error …

Member Avatar for deceptikon
0
488
Member Avatar for somjit{}

I only glanced over your post, but I'm 99.9% sure that it's the classic stream garbage problem when mixing formatted and unformatted input. You see scanf() is special in that most of the time it will discard leading whitespace from the stream and *leave* trailing whitespace. gets() on the other …

Member Avatar for WaltP
0
393
Member Avatar for Dani

It might be just you, I haven't seen that issue at all. At least not with Chrome, what browser are you using to test with?

Member Avatar for nitin1
4
196
Member Avatar for nitin1

This thread was marked as solved. Did you solve your own problem? On a side note, is it really so hard to type "input"? I mean, it's got to be less awkward to type and is only two keystrokes longer.

Member Avatar for np complete
0
131
Member Avatar for ConfusedLearner

First you have this: #define radius Then this: cout<<"\nRadius is " << radius << set(8)<< "PI is" <<PI; What exactly were you expecting to get printed when radius is replaced with nothing? The end result after preprocessing is this: cout<<"\nRadius is " << << set(8)<< "PI is" <<PI; And that's …

Member Avatar for Lucaci Andrew
0
224
Member Avatar for shikha lawrence

> i want to gain full knowlege of programming language.. Um...programming isn't that simple. Not even the creator of a programming language has "full" knowledge of it, because "full" knowledge encompases more than just the trivia of syntax and semantics. Even if you're a book smart pedant who can quote …

Member Avatar for deceptikon
0
207
Member Avatar for markwiering

> My program doesn't have mistakes, because I already solved them. :-D This is the difference between a beginner and someone with experience. You think you've made no mistakes and your program has no bugs. We *know* we've made mistakes and are grateful when someone finds a bug. Drop the …

Member Avatar for markwiering
0
1K
Member Avatar for Octet

Your situation sounds perfect for going to university. You'll have a better idea of whether you want to do something with computers after taking classes and and if nothing else leave with a degree that will help you get a job.

Member Avatar for roillinpr
0
193
Member Avatar for general45
Member Avatar for sdstim
Member Avatar for Izslahi

The conio library is nonstandard and thus not supported by all compilers. If you can remove the parts of conio that you use (such as a leading clrscr() or a trailing getch() in your main() function), that's probably the best approach. Otherwise you'll need to look for alternatives or change …

Member Avatar for Izslahi
0
147
Member Avatar for somjit{}

> if (c == ' ' || c == '\n' || c = '\t') One of these things is not like the other. Look very closely, I'm sure the book didn't mix up operators.

Member Avatar for WaltP
0
199
Member Avatar for triumphost

If you have two non-black spots going in different directions from a cell, then that's an intersection: bool is_intersection(char board[M][N], int x, int y) { if (board[x][y] == '#') return false; return (board[x - 1][y] != '#' || board[x + 1][y] != '#') && (board[x][y - 1] != '#' || …

Member Avatar for deceptikon
0
424
Member Avatar for enakta13

> Please shut up if you don't know how to code... Thank you so much for that comment. I might have actually wasted time helping an ungrateful jerk. I really appreciate your concern for everyone's time. Best of luck with your problem.

Member Avatar for TrustyTony
0
162
Member Avatar for ArYan.AgRwl

> A program for > >A BC DEF GHIJ KLMNO That's kind of weird, but okay: #include <iostream> using namespace std; int main() { cout << "A\nBC\nDEF\nGHIJ\nKLMNO\n"; } p.s. We're not your coding slaves. Posting your homework without even a please or thank you again will find it deleted. Please …

Member Avatar for deceptikon
0
83
Member Avatar for crackerjr

> No this is not a school assignment...just something i thought i'd practice That doesn't remove the onus of making an honest attempt.

Member Avatar for deceptikon
0
124
Member Avatar for dmose13
Member Avatar for kinge504
Member Avatar for amitie.boo
Re: game

> can anyone do me a project on this !! plzz You're joking, right?

Member Avatar for neogills
0
86
Member Avatar for BlueDevil

> For flushing input stream, there is a nice article in daniweb C++ forum. Check this. And the suggested solution is also for C++ only, it won't work in C because there's insufficient framework in the stdio library to support it.

Member Avatar for deceptikon
0
212

The End.