6,741 Posted Topics

Member Avatar for maheswari c

I want a publisher to let me write a book on C. But wanting something doesn't make it happen, especially when it involves other people doing work for you with no benefit to them.

Member Avatar for Duki
0
49
Member Avatar for lapunluyang

[B]>Well, that was a giveaway. I answered 'YES'.[/B] The giveaway was that the statement is so biased as to be immediately false. The king of all languages and the best ever made? You seriously answered yes to that? :D [B]>It's been like 7 years, but C++ still holds its rank …

Member Avatar for Ancient Dragon
0
163
Member Avatar for Clawsy

[B]>Hmm... keeping the dictionary in an external file seems like the best approach to me. Correct me if I'm wrong.[/B] How do you suggest looking up a word? Search the file each time? Unless it's a properly designed external database, that's going to be very inefficient. The words will likely …

Member Avatar for Adak
0
151
Member Avatar for binary_boy

Assuming you need to do it all manually, how about redirecting output to a temporary file? Then you can echo the temporary file to the screen as well as append it to your log file.

Member Avatar for binary_boy
0
93
Member Avatar for dasari.prasad

[B]>First C compiler program compiled on which compiler..???[/B] Unknown, but probably either an assembler or Ken Thompson's B compiler on the PDP-11.

Member Avatar for Narue
-1
129
Member Avatar for Ancient Dragon

I like the explicit nature of the new rules. They should be much easier to enforce as well as making more sense to regular members.

Member Avatar for Geekitygeek
0
157
Member Avatar for vbx_wx

Technically it is cleaned up, unless you're on a platform that doesn't reclaim dynamic memory for a process when the process terminates. But if you mean the pointer is never deleted explicitly, that's easy enough. Just print something in the destructor, throw an unhandled exception, and watch the message never …

Member Avatar for Narue
0
71
Member Avatar for Geekitygeek

[B]>Is it just me, or do you find your patience stretched rather thin when posting here at Daniweb sometimes?[/B] Sometimes? When the majority of questions are students looking for a handout, a constant state of zero patience is normal. Though I have infinite patience for people who are truly interested …

Member Avatar for Geekitygeek
0
269
Member Avatar for radioman28

>Because these are the mother languages and if u master these >language it will not take much time to learn other languages. Cool, so if I learn C, C++, or Java then I can pick up Lisp, Forth, or Assembly with no problem? What, pray tell, are these the mother …

Member Avatar for ocmseo
0
668
Member Avatar for ganesh_IT

The two aren't related. Assertions are for catching bugs in the code, exceptions are for managing legitimate errors when the program runs.

Member Avatar for LordNemrod
0
74
Member Avatar for paula_m

Adak forgot to allocate memory to molid and molc. For testing purposes, just make those large arrays and see if it works better: [code] struct estr_reg { char molid[BUFSIZ]; char molc[BUFSIZ]; }; [/code]

Member Avatar for samkaraja
0
214
Member Avatar for lonely_girl
Re: HELP

Teachers don't give assignments to do things that haven't been discussed in class. Please don't treat us like idiots. Try asking your question again, this time with enough detail for someone to actually answer it.

Member Avatar for Adak
0
256
Member Avatar for dany12

[B]>the most useful programming languages are ASP.NET,PHP,java[/B] According to TIOBE, Java is the most popular language, and PHP is 4th (with C and C++ in between). But seeing as ASP.NET is a framework rather than a language, your credibility is suspect when it comes to listing the most useful languages …

Member Avatar for leo002000
0
110
Member Avatar for Syeda_Amna

[B]>So kindly hlp me out to decide it...[/B] I fail to see how we can help. We know nothing about your knowledge or about you...except that you're exceedingly uncreative and generally clueless about what you've been studying for the last N years.

Member Avatar for emigrant_tech
0
77
Member Avatar for titan_31

Once link becomes a null pointer, you've left the realm of the tree. Assigning to link at that point does nothing productive. What you need to do is save a pointer to the last node before link become null, and then assign tmp to either the lc or rc link …

Member Avatar for Narue
0
177
Member Avatar for Danny_501

[B]>char *timeBegin = (char *)malloc(sizeof(char) * 21);[/B] timeBegin is assigned a pointer to dynamic memory. [B]>timeBegin = time_stamp();[/B] timeBegin is immediately re-assigned to a different pointer, which is not dynamically allocated. The first pointer returned by malloc is [i]lost[/i] forever, thus causing a memory leak. [B]>free(timeBegin);[/B] You're not allowed to …

Member Avatar for Narue
0
121
Member Avatar for Auraomega

What will you do when stdout is redirected to a file? The file descriptor approach is conventional, and your flag idea seems awkward at best. There will be a lot of special cases with the flag while a file descriptor just works naturally.

Member Avatar for Auraomega
0
102
Member Avatar for chubbs1900

>But then i have to modify the inner loop to instead of starting >from 1 each time, start from a value that increments the start value. Currently you set numCtrl to 1. What happens when you set it to 1 + linCtrl? :) >Lastly, the spacing.... crap.... Add another loop …

Member Avatar for usman.rose
0
311
Member Avatar for sainiricha

>I just want to validate that the entered text in the text box is of correct format(date type). Try to [url=http://msdn2.microsoft.com/en-us/library/system.datetime.tryparse.aspx]parse[/url] it.

Member Avatar for M. Ashok Reddy
0
270
Member Avatar for meer pakala

Read code, write code, read any literature on C you can find. There's no magic bullet, just hard work.

Member Avatar for GreatWin-Win
0
233
Member Avatar for faisal.alawar

This is a trivial homework assignment and we won't help you cheat. Do it yourself.

Member Avatar for prvnkmr449
-1
210
Member Avatar for rahul8590

[B]>no it doesnt ..[/B] Did you use it correctly? [code] fprintf(stdout,"hello-out"); fflush(stdout); fprintf(stderr,"hello-err"); [/code] stdout is buffered by default while stderr is not. The three ways to flush a buffered stream are filling it up ("hello-out" is unlikely to do that), printing a newline (which you don't), and calling fflush.

Member Avatar for Narue
0
141
Member Avatar for macrogeek

[B]>Well, casting is not the same thing as typecasting.[/B] Erm, yes it is. [B]>Typecasting just creates an "alias" (another name), your program >can use, for a certain datatype (typically a struct name).[/B] You're thinking of typedefing. Casting, typecasting, explicit conversion, and type coercion are pretty much the same thing. [B]>A …

Member Avatar for manojwali
0
214
Member Avatar for Sinaru

Memory errors are funny beasties. One reason they're so hard to debug is the symptoms are often unpredictable. So while I would be thrilled to get a SIGABRT, I wouldn't expect or rely on it.

Member Avatar for manojwali
0
592
Member Avatar for krille_x
Member Avatar for illuminatus89

[B]>I know that by declaring a variable as 'const', its stored in read only memory[/B] Incorrect. There's no rule that says const qualified objects must be stored in read-only memory. [B]>I found that a const variable's value can be changed using pointers.[/B] Maybe, maybe not. Attempting to modify the value …

Member Avatar for manojwali
0
104
Member Avatar for lytnus

[B]>If I have to have an abstract base class with all functions from every derived >Node class, why don't I just have one Node class with heaps of functions in?[/B] Indeed. Polymorphism is meant to share a common interface with varying behavior. Your problem is trying to use polymorphism with …

Member Avatar for lytnus
0
292
Member Avatar for myk45

[B]>Well, unlike C, C++ provides a concept of headers(not header files)[/B] The concept of headers is identical between C and C++.

Member Avatar for Fbody
0
173
Member Avatar for TheSecOrg

Why do you want to do that instead of learning a proper graphics library? Not that I don't enjoy a nice ASCII art game every now and again, but console-based graphics are a little retro for serious software.

Member Avatar for PixelExchange
0
120
Member Avatar for xshashiy

Since you already know the range of the sequence, and it's small, and you want non-repeating values, a random shuffle would be a better option than trying to check whether each new number was already generated or not: [code] #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 157 int main …

Member Avatar for DKdontKNO
0
549
Member Avatar for maceron

When you overflow or underflow an unsigned type, wrap-around occurs. Due to unsigned wrap-around, -1 becomes the largest unsigned value for the type. One common trick is taking advantage of that effect for decrementing loops on an unsigned counter without having to know the actual range of the type: [code] …

Member Avatar for maceron
0
213
Member Avatar for Michael_Grumbac

[B]>I have to take a course as a requirement for a new job.[/B] They don't offer suggestions? Or are you trying to meet certification requirements for the job? Sorry, but this all sounds very strange to me. [B]>I know that creating libraries doesn't take this long to learn.[/B] Creating [I]good[/I] …

Member Avatar for Michael_Grumbac
0
253
Member Avatar for dineshcbe

[B]>it writes the content two times into the file.[/B] Close. It writes the content once, but because of a common bug you read it twice. [B]>while(!file.eof())[/B] This is the bug. eof only returns true after you've tried and [i]failed[/i] to read from the file. Using it as a loop condition …

Member Avatar for Narue
0
131
Member Avatar for eniine

[B]>this is for an exam that a need here in my job[/B] Your job? Dare I ask what kind of job gives exams that look a lot like elementary CS homework? You're clearly not a professional developer, judging by your code and complete inability to solve this simple problem.

Member Avatar for Nick Evan
0
244
Member Avatar for b1izzard

Well, the error tells you what line the error manifests on, so your first step would be to run your program in a debugger (or use debug printfs if you want to go old school) and verify the state of the variables. Most likely one of your indices is incorrect …

Member Avatar for b1izzard
0
128
Member Avatar for rtirak

[B]>If someone can please give me an example on how this is done so I >can use it to refrence to do thi sproject or show me how to do it.[/B] Reference, my ass. Go do your own homework, slacker.

Member Avatar for rtirak
0
167
Member Avatar for sabeeh ahmed

[B]>i have made the prog[/B] Then you shouldn't have any trouble proving it.

Member Avatar for sabeeh ahmed
0
92
Member Avatar for chris forgeard

rand is always seeded to 1 by default. You can change that by calling srand. May I suggest [URL="http://www.eternallyconfuzzled.com/arts/jsw_art_rand.aspx"]this article[/URL]?

Member Avatar for Narue
0
133
Member Avatar for civus
Member Avatar for grahf23
Member Avatar for grahf23
0
157
Member Avatar for David_Omid

>cannot convert parameter 1 from 'std::string' to 'System::String ^' You're mixing standard C++ strings with C++/CLI strings. There's a fundamental difference in that C++/CLI strings are Unicode based while std::string is char based. The least frustrating solution would be to pick one and stick with it, but you can also …

Member Avatar for David_Omid
0
93
Member Avatar for amarnathch

[B]>How could i know the total elements an array can store???[/B] You're guaranteed at least 65535 / sizeof(T) where T is the type of the array. 65535 is the minimum limit for an object in C.

Member Avatar for Narue
0
95
Member Avatar for Narue

The purple bar at the bottom of the page is not working properly when I browse Daniweb on my iPad (presumably the iPhone has the same problem). Rather than stick to the bottom of the browser window, it locks to the original position and obscures everything at that point (which …

Member Avatar for creeps
0
170
Member Avatar for creeps

mw_get_command is recursive. I don't recommend recursive functions that are linear in nature or potentially infinite. Yours is both. A loop would be just as easy to implement: [code] void mw_get_command(char *cmd) { for (;;) { int ch; printf("Enter a command: "); fflush(stdout); /* Trim leading whitespace */ while ((ch …

Member Avatar for creeps
0
102
Member Avatar for dflatt

I'd probably use a database, because tables like this usually end up needing far more robust querying than I'd want to write ad hoc. But I don't see a problem with a vector of objects where each object represents the match up if all you're doing is updating, sorting, and …

Member Avatar for dflatt
0
112
Member Avatar for CPT

[B]>After reading about this topic and algorithms from the book by Cormen, I started to implement it.[/B] I've written some articles on the subject with C as the implementation language. You may find them more helpful than your book as the code can be plugged in directly rather than requiring …

Member Avatar for CPT
0
153
Member Avatar for dorien

When you use the <c*> headers as opposed to the <*.h> headers, don't forget that everything is now in the std namespace: [code] int x = 300; char out[4]; std::memcpy(out, &x, sizeof(int)); [/code] And memcpy is declared in <cstring>, not <cstdio>.

Member Avatar for dorien
0
4K
Member Avatar for helpme87

[B]>char accountNum[6];[/B] If you're using std::map, there's probably no restriction on using std::string as well. I'd highly recommend avoiding C-style strings because they're just too awkward. While C++ isn't known for it's string handling capabilities, std::string is still a vast improvement. [B]>map<char,int , ltstr> report;[/B] Assuming std::string: [ICODE]std::map<std::string, int> report;[/ICODE]. …

Member Avatar for mrnutty
0
149
Member Avatar for DemiSheep

[B]>I am basically trying to see which is the most efficient way of writing this code.[/B] At this point I'd say that trying to micromanage your memory usage and CPU cycles is unproductive. Both options are extremely likely to be fast enough for your purposes, so it doesn't matter which …

Member Avatar for jon.kiparsky
0
192
Member Avatar for CJX3711

I'm not hip on the latest web development stuff, but it sounds like you want a CGI script in C++. That could be a good start for research into a solution.

Member Avatar for CJX3711
0
137

The End.