3,183 Posted Topics

Member Avatar for johnray31

> Actually, this is very easily done...that is if you did some basic C-language based I guess- programming including pointers. In C, since you can use pointer arithmatic on a pointer that you have malloced initially. So, if you are to say make a pooled memory-or given a memory space …

Member Avatar for np complete
0
1K
Member Avatar for Carpetfizz

If you want to write standard C++, I'd strongly recommend only using an empty project. Then you don't have to deal with Microsoft's precompiled headers (stdafx.h) or any of their character width agnostic types. The _T stuff is supposed to use the correct width character type depending on whether a …

Member Avatar for Carpetfizz
0
267
Member Avatar for ronnel09

Whether it's simple or not depends on how well you know C, but I think the following is trivial: #include <stdio.h> #include <time.h> int main(void) { struct tm d1 = {0}, d2 = {0}; d1.tm_year = 2012 - 1900; d1.tm_mon = 7; d1.tm_mday = 18; d2.tm_year = 2011 - 1900; …

Member Avatar for rubberman
0
102
Member Avatar for Jarreds

> Verifies that a legitimate 24hour notation has been input by using the assert statement Just so you understand, this is an extremely poor practice. The assert() macro should only be used for shaking out bugs because it invokes a hard stop on the process. Here you're using it for …

Member Avatar for TrustyTony
0
239
Member Avatar for _avishek

> My understanding of the C language is that the same identifier cannot be reused. That's correct, but only within the same name space (not the same as a C++ namespace). There are five listed name spaces in C: 1. Label names (such as cases and goto labels). 2. Structure, …

Member Avatar for _avishek
0
238
Member Avatar for ronnel09

Type everything on one line, then press enter. scanf() is natrually designed to handle this kind of input unless you go out of your way to ensure that each number is on a separate line. But even then, after you hit enter the cursor will move to the next line. …

Member Avatar for deceptikon
0
234
Member Avatar for shanki himanshu

The pioneering spirit appears to be dead, at least among the latest generation of programmers.

Member Avatar for _avishek
-1
118
Member Avatar for ronnel09

I'm again assuming that your output is to the command prompt. And the answer is yes, but not as easily as setting a center attribute. When it comes to "formatting" in the command prompt you need to fill the line with leading spaces to put it where you want. For …

Member Avatar for WaltP
0
300
Member Avatar for nabeelbhutto

> don't say do it by your self i could'nt understand thats why i am asking from you if i know then why i ask i don't know thats why i am asking friends plz help me...!! Please don't just post your assignment and say you don't understand, that's not …

Member Avatar for sfuo
0
732
Member Avatar for I_m_rude

> A list is there in which infinite numbers(approx 1 lakh) 1 lakh is hardly infinite. Hell, I wouldn't be against bubble sorting an array of 100,000 items on modern hardware, and bubble sort is the canonical "slow" algorithm. > I know this question will be solved by using heap(min …

Member Avatar for sfuo
0
146
Member Avatar for vinnitro

> zeroliken you are wrong > Its not the right answer Then what do you think is the right answer? The sequence you showed is clearly 5^n at every step. If the 5th step isn't 3125 (5^5) then either you didn't provide sufficient information about the sequence to reach the …

Member Avatar for mrnutty
0
96
Member Avatar for shanki himanshu

strrev() isn't a standard function, so compilers aren't obligated to support it. What compiler are you using?

Member Avatar for WaltP
0
2K
Member Avatar for marinelle

How about *"A Proposal to leave the dark ages and start doing the same shit everyone else with any sense has had in place for two decades"*? ;D But seriously, something that highlights the benefits of the system would be a good idea. Like *"Streamlining the book borrowing process"*, or …

Member Avatar for deceptikon
0
97
Member Avatar for ronnel09

I'm no longer hip on Turbo C stuff, but if textcolor() works in any sane manner, it should set the color to whatever you chose until the next call. So for one word: textcolor(WHITE); printf("You chose: "); fflush(stdout); textcolor(RED); printf("RED\n"); textcolor(WHITE);

Member Avatar for ronnel09
0
131
Member Avatar for SHASHWATH

Daniweb is not a homework service. Please make an honest attempt to solve the problem yourself, then ask specific questions if you need help.

Member Avatar for WaltP
-3
146
Member Avatar for milon.mahapatra

Do you just need to read it line by line, or do you need to actually tokenize and parse the verilog language?

Member Avatar for milon.mahapatra
0
237
Member Avatar for I_m_rude

It will be "nitin". `s` can't be a null pointer because it's an array.

Member Avatar for I_m_rude
0
140
Member Avatar for blue_Student

It's generally advisable to use fgets() to retrieve a line, then parse the line in memory, possibly with sscanf(). But the needs of your program override general advice, and it looks a lot like you need to tokenize a function call for a compiler. What does the file represent, and …

Member Avatar for blue_Student
0
660
Member Avatar for shanki himanshu
Member Avatar for shanki himanshu
0
233
Member Avatar for paulsoncole

> so what should i do to fix the problem. You should post your code so that we don't need a crystal ball to figure out where the problem is and what's causing it. Would you ask a mechanic to fix your car without actually bringing the car? > pls …

Member Avatar for deceptikon
0
110
Member Avatar for rithish

Just for the record, when someone talks about occurrences they almost never mean combinations. As for how this works, it recursively builds a tree that breaks down the string, swaps elements, and recombines them to produce combinations. When you have an algorithm you don't understand, the best approach is to …

Member Avatar for deceptikon
0
285
Member Avatar for np complete

Use the difference of the two numbers as the upper end of the range, then add the lower number: x = lo + rand() % (hi - lo); This assumes that lo isn't greater than hi. Also, strange things happen with negative numbers, so ideally the range would be positive.

Member Avatar for deceptikon
0
218
Member Avatar for roland.ahsue

Nobody is going to do your homework for you, and calling it a competition isn't going to fool the vast majority of us. Please read our rules, provide proof of effort, ask some questions, and we'll help you do it.

Member Avatar for deceptikon
-2
180
Member Avatar for ramadan10

As a measure against spammers and scammers, we disallow sending PMs until you've posted enough, gained enough reputation, or been a member long enough to reach the rank of Community Member. The requirements aren't stringent at all (15 rep points or 5 posts + 5 days), but it ensures that …

Member Avatar for WaltP
0
132
Member Avatar for rithish

#include <stdio.h> #define MAX 5 void store(int a[], int i, int n); int main(void) { int a[MAX]; int i; store(a, 0, MAX); /* Test the result */ for (i = 0; i < MAX; ++i) printf("%d ", a[i]); puts(""); return 0; } void store(int a[], int i, int n) { …

Member Avatar for rithish
0
162
Member Avatar for rithish

> Not in C or C++. Index values must be positive. As long as the index refers to some location in the array's boundaries, indices may be positive or negative. For example: int a[] = {1, 2, 3, 4, 5}; int *p = a + 2; printf("%d\n", p[-1]); /* Perfectly …

Member Avatar for deceptikon
0
129
Member Avatar for gem.gonzales.9

You don't have a prototype for gem(), you're not passing the required arguments, getch() requires conio.h to be included, and relying in implicit int for main()'s return type is poor practice give that this feature was removed in C99.

Member Avatar for rithish
0
140
Member Avatar for milindchawre

Are you posting code to show others, or do you have problems with that program that you need help with? If it's the latter, please ask a question. If it's the former, let me know and I'll turn this thread into a code snippet.

Member Avatar for deceptikon
0
126
Member Avatar for rotten69

While it may be all in good fun, I don't see any reason to hide the numbers or the titles. Especially given that it's public knowledge anyway, if you're willing to search through our members to figure it all out (which would be tedious and annoying). I suspect we have …

Member Avatar for rotten69
0
449
Member Avatar for henicken

Daniweb is not a homework service. Please provide some proof that you've attempted to write this program on your own.

Member Avatar for np complete
-3
89
Member Avatar for amar11372

Because 999 is ultimately being broken down into 3 calls of fun(9), which when added together produce 24. The recursive tree looks like this: fun(999) | +-> fun(99) | | | +-> fun(9) | | | | | +-> return 8 | | | +->fun(9) | | | +-> return …

Member Avatar for DeanMSands3
0
123
Member Avatar for triumphost

> I'm not sure when to use long vs int. Use long when the value stored in the variable may exceed 16 bits. int is only guaranteed to be at least 16 bits and long is only guaranteed to be at least 32 bits. C++11 supports the long long data …

Member Avatar for deceptikon
0
161
Member Avatar for jere.saw

I think you may have posted prematurely. The referenced "following" statements aren't present.

Member Avatar for WaltP
0
53
Member Avatar for Andrei15193
Member Avatar for love_you_4rever

Your copy constructor doesn't do anything meaningful, which means that precedes() will always get a garbage initialized Date object. You also forgot to increment `day_` in advance(), which means the loop in main() will run forever. I find it odd that you say only "Monday" is ever printed when the …

Member Avatar for rubberman
0
467
Member Avatar for manishanibhwani

> does this mean that the user needs to enter another input (may be a string or an integer or so) so that the scanf returns? It means there needs to be at least one non-whitespace character after all of the whitespace characters. When you put whitespace in the format …

Member Avatar for WaltP
0
180
Member Avatar for shanki himanshu

I imagine it's not printing because root is *not* NULL. Change your if statement's test to if (root != NULL) cout<<root->info;

Member Avatar for I_m_rude
-1
158
Member Avatar for I_m_rude

[This](http://comeoncodeon.wordpress.com/2009/09/17/binary-indexed-tree-bit/) was the first hit on google.

Member Avatar for I_m_rude
0
122
Member Avatar for matt.malone.921

You can get more information by printing the error message with perror(): if ((fp = fopen("new.txt", "r")) == NULL) { perror("Error opening new.txt"); ... } But I notice that you have a rogue semicolon after the condition of your if statement, which means that the printf and return will *always* …

Member Avatar for Sokurenko
0
90
Member Avatar for titusnainggolan

> I want to get output which same as the input. Then use strings. Floating-point is inherently imprecise due to the limitations of the machine and gains or losses from rounding. It's unreasonable to expect the internal representation of a value to be exactly what the user typed for input, …

Member Avatar for WaltP
0
376
Member Avatar for bo0ga

In all honesty, you'd be better off looking for a job in IT and then transitioning into development. That's what I did, and the IT experience has proven invaluable as a developer.

Member Avatar for stultuske
0
133
Member Avatar for Vish0203

What compiler, OS, and IDE are you using? The simple answer is that you need to add an icon resource to your project and include that resource in the build. But that doesn't answer your question of *how* to do it.

Member Avatar for Vish0203
0
113
Member Avatar for gerbil

> Markdown is a pain. I still haven't decided yet if Markdown's finickiness is an improvement over BBCode's verbosity, but there's no argument here that both can be a pain.

Member Avatar for gerbil
0
186
Member Avatar for dinohead

Open a file stream using fopen(), then call fprintf() instead of printf(). Alternatively, you could redirect stdin into a file, but I don't get the impression that this is what you want.

Member Avatar for deceptikon
0
160
Member Avatar for lxXTaCoXxl
Member Avatar for Tinnin

Ignoring the questionable use of goto here, you never initialize or update the value of `a`, yet that value is assigned to `j` when a number is not prime. That raises red flags. If the purpose of this algorithm is to print the primality of every number from [1,N] then …

Member Avatar for deceptikon
0
160
Member Avatar for KasmIR

> cannot convert parameter 1 from 'char *' to 'LPCWSTR' LPCWSTR is a wide character type. Make sure you don't have Unicode enabled anywhere in your project or code if you don't intend to use the wide character functions. > unsafe operation: no value of type 'bool' promoted to type …

Member Avatar for deceptikon
0
244
Member Avatar for rithish

There's no stack overflow, you're trying to dereference an uninitialized pointer. I'm not sure what to tell you at this point because you seem to completely ignore the advice of people who are trying to help you, and continually try to write code that you **obviously** lack the prerequisite knowledge …

Member Avatar for WaltP
0
516
Member Avatar for SHASHWATH
Member Avatar for shkr

Daniweb isn't a free code service. Please write the code yourself and ask specific questions if you need help doing so.

Member Avatar for Sokurenko
0
295

The End.