6,741 Posted Topics

Member Avatar for NagendraR

>can any one help me with any logic for serialization in C/C++ There's not just one way to do it. How you serialize a structure depends on the type and contents of your structure. But an easy (and verbose) way is to save the contents as a delimited string: [code] …

Member Avatar for Narue
0
248
Member Avatar for desertstorm

>Do I need to initialize 'word' to a constant size before using it? Yes, otherwise it's an incomplete type that you can't use. >The thing is I don't know how big the string from strtok is going to be >and I will constantly be using 'word' to store different size …

Member Avatar for Narue
0
136
Member Avatar for tachoink

Is this a VB question? Maybe you should ask in the VB forum. Thankfully, C++ and VB are [b]not[/b] the same thing. :)

Member Avatar for tachoink
0
108
Member Avatar for kdw3

>the command prompt shuts down before anything is displayed Actually, everything is displayed just as you intended, but the window closes too fast for you to see that. This is a common problem that can be fixed simply by asking for input before the program terminates: [code] #include <iostream> #include …

Member Avatar for Narue
0
602
Member Avatar for simon126

What have you tried so far? Unless you show us your attempt, we'll assume that you didn't even try to think about it before running here for help.

Member Avatar for Lerner
0
261
Member Avatar for ankitrastogi82

I'm sorry, I tossed out my crystal ball years ago. You'll have to be more specific instead of expecting us to read your mind. As given, your question is ambiguous.

Member Avatar for Rashakil Fol
0
142
Member Avatar for rekkoha

Just hang around here. There are armies of noobs with Turbo C/C++ on Windows XP itching to write games. I'm sure someone will post what you want in the next 20 minutes or so, judging from the frequency with which we see people like that.

Member Avatar for Narue
0
101
Member Avatar for Manojsah
Member Avatar for PeterX

> 'count' : redefinition; different basic types What compiler and operating system? And are you compiling as C or C++?

Member Avatar for PeterX
0
100
Member Avatar for goldeagle2005

>what are Reputation Points? A frivolous and pointless feature that nobody cares about. >And how exactly does this system work? If you see a post you like, you can give the poster good rep. This increases that person's reputation by a certain number of points depending on how many points …

Member Avatar for Dani
0
392
Member Avatar for alajaji

shaji: Your code is horribly, horribly broken. Before you try to teach C, please learn it first. alajaji: We don't do homework. Show your attempt.

Member Avatar for shaji
0
212
Member Avatar for tkaung80

Just to clarify, you'll be hard pressed to find a C++ compiler that doesn't have a switch that forces it to compile C. They're also more likely to be up to date than the C only compilers you'll find.

Member Avatar for calcop
0
410
Member Avatar for Micko

>I think Narue wrote it on another forum. I sure hope not. You're looking at a common bug/assumption with the heapsort algorithm. A lot of the time, people writing about heapsort will assume that arrays are 1 based instead of 0 based, which results in an off-by-one error when an …

Member Avatar for Micko
0
262
Member Avatar for SpS

>biggest overheads with goto is having your peers laugh at you. Amen. Of course, I would say that the biggest overhead at first is constantly having to defend your decision to use a goto. Even if you use it intelligently, there are armies of the ignorant waiting to flame you …

Member Avatar for Narue
0
151
Member Avatar for BoogaBooga

>but you don't have that many active posters/posts Daniweb is more than just a forum, a fact that Dani has been trying to emphasize with the new design. And forum activity can't be measured with new posts alone. A lot of people lurk but don't post for various reasons. A …

Member Avatar for >shadow<
0
201
Member Avatar for kahaj

>What purpose exactly does scaling / shifting rand values serve? rand gives you a number from 0 to some big value. Sometimes you don't want that. Sometimes you want a number from 0 to 10. But if you might get a number from 0 to 32767, you need to force …

Member Avatar for kahaj
0
270
Member Avatar for jackdog1

>So What Is Everyone's Beef With Aol Anyway???? There has to be a reason? Now, capitalizing every word in a sentence, there's definitely a reason why [b]that[/b] is annoying.

Member Avatar for goldeagle2005
0
525
Member Avatar for steveaustin

>This is what you want ? No, that's not what he wants, but it's exactly what he deserves. Broken code using poor practices so that he'll get a failing grade even if he isn't expelled for cheating. For future reference invisal, we don't do homework for other people because it …

Member Avatar for Narue
0
128
Member Avatar for Joaquine

That's a subtle error telling you that functions don't nest in C++. But aside from that, your use of whitespace is painfully inconsistent, and you have too many pointless comments. Here is your code corrected, cleaned up, and reorganized to be more transparent, though I haven't run it: [code] // …

Member Avatar for Joaquine
0
138
Member Avatar for Asif_NSU

>Hmm, that's weird. No, it's not only understandable, it's expected. Everybody is a hypersensitive weenie these days. The fall of the human race is entertaining to watch.

Member Avatar for server_crash
0
642
Member Avatar for Elthran

>cin.ignore(numeric_limits<streamsize>::max(), '\n'); If you're going to use this solution, you need to include <limits> to get access to std::numeric_limits<>.

Member Avatar for ITgeneration
0
947
Member Avatar for jewboy

>Does he or she win a free turkey? A life. And he or she can have yours since you're obviously not using it.

Member Avatar for >shadow<
0
296
Member Avatar for vartotojas

>To my knowledge with cin you must press enter to assign whatever they typed to a variable. Correct. Input in standard C++ is line oriented, so to read raw input you need to use a system-dependent or compiler-dependent solution. [url=http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048384015&id=1043284392]This[/url] is offers three such solutions, but since you didn't tell …

Member Avatar for vartotojas
0
127
Member Avatar for heavyc

>can someone help?? I think I'm done trying to help you. You seem completely incapable of doing anything on your own. p.s. The next thread you start with this same question will get deleted.

Member Avatar for Narue
0
126
Member Avatar for heavyc

Here is the basic idea behind what you're trying to do: [code] // Pseudocode for ( i = first; i != last; i = next ( i ) ) { for ( j = next ( i ); j != last; j = next ( j ) ) { if …

Member Avatar for Narue
0
279
Member Avatar for stupidenator

Is this C or C++? How is the date originally stored? I assume it's a string, but you need to be more specific about what you need or we'll be of no help to you.

Member Avatar for stupidenator
0
222
Member Avatar for kbradley

Vectors are evil, look up the ArrayList if you want an array that grows as needed.

Member Avatar for jwenting
0
246
Member Avatar for SpS

>Can we find the smallest of three integers, without using any of the comparison operators....logic please Can we find out why you're interested in such a silly problem? Logic please.

Member Avatar for SpS
0
319
Member Avatar for ashwinperti

>But this function always prints NO. The only thing that function should print is a compiler error and at least one warning if your compiler is half decent. >Why is it so with float variable It has nothing (or rather, little) to do with your choice of types. 0.7 is …

Member Avatar for Balachandran
0
169
Member Avatar for SpS

>but still it gives the same dialog box....is there any way to switch it off The way it's supposed to work is that you define NDEBUG and it disables debugging assertions. Will it work in this case? I doubt it, because if there is a hardcoded limit in your memory …

Member Avatar for SpS
0
127
Member Avatar for SpS

>sizeof (int) gives me 4 bytes...is it sufficient to say that my machine is of type 32-bit For your intended purposes, it probably is sufficient. But even if a machine supports 32-bit integers or has a 32-bit address space that doesn't mean it's a 32-bit machine. The term 32-bit machine …

Member Avatar for SpS
0
357
Member Avatar for Drowzee

>how in blazes does one know if the results of multimapname.find >("Whatevah") will give me access to the correct value (ie, column) I want to check? One doesn't know. The order of duplicates in a multimap is unspecified.

Member Avatar for Drowzee
0
250
Member Avatar for heavyc

Talk about bending over backward to use a linked list when a binary search tree would easily solve the problem. Let's start by figuring out which part of the task is giving you trouble. Do you know what a linked list is? Have you ever written one? Start by inserting …

Member Avatar for Narue
0
317
Member Avatar for SpS

No, malloc returns a null pointer if it fails, just like in C. So you should always test for success like this: [code] p = malloc ( n * sizeof *p ); if ( p == NULL ) { // Handle malloc failure } [/code] Of course, in C++ there's …

Member Avatar for Narue
0
560
Member Avatar for bumsfeld

>A NULL pointer is a pointer that points to address 0 Bad dragon, now you're just confusing people. A null pointer doesn't have to refer to a specific address, and just because 0 is a null pointer constant doesn't mean it points to address 0.

Member Avatar for Ancient Dragon
0
236
Member Avatar for bumsfeld

>I need to write about a half one page instruction string for one of my C++ programs. Try again, this time in coherent English, please.

Member Avatar for Narue
0
319
Member Avatar for BountyX

>how would i feed the processor raw binary in C/C++ ? Use embedded assembly. That's the closest you'll get if you have to ask this question.

Member Avatar for BountyX
0
156
Member Avatar for ashwinperti

>I want to know why is it so that, in the Case of C Language there is no >need to include stdio.h Header file. It's a (mis)feature in C89 to provide backward compatibility with K&R C. Don't take advantage of it though, you'll end up causing yourself more problems than …

Member Avatar for Narue
0
116
Member Avatar for needCee

Aside from beeing formatted poorly and riddled with undefined constructs, what is it not doing that you want it to? Posting a vague question and ugly code isn't likely to get you a useful answer, so you need to work with us if you want help solving your problem.

Member Avatar for needCee
0
129
Member Avatar for SpS

>Yes you can Once you realize that it's a stupid trick question, of course. ;)

Member Avatar for Narue
0
213
Member Avatar for Niklas

The only difference is asking for an operator too: [code] #include <iostream> using namespace std; int main() { int a, b; char op; cin>> a >> ws >> op >> b; if ( op == '+' ) cout<< a + b <<'\n'; else if ( op == '-' ) cout<< …

Member Avatar for Narue
0
365
Member Avatar for pit_bull

Don't spam the forums, this isn't a chat room. You're lucky I'm in a good mood or I would have deleted this thread too and had you banned for ridiculously inappropriate behavior. >please tell me what to do You're using an ancient compiler, probably on a Windows XP system. It's …

Member Avatar for Narue
0
267
Member Avatar for aminura

So? C++ doesn't try to stop you from trying to do stupid things. How about instead of asking why you can do something blatantly wrong, DON'T DO IT TO BEGIN WITH.

Member Avatar for aminura
0
373
Member Avatar for glamo

>if(printf(5+"Good")>0) There's nothing to explain. This program is broken. Change the 5 to a 4 and you won't invoke undefined behavior, but nothing will be printed because you're sending printf an empty string. If you add 1 to "Good", you get "ood". If you add 2 to "Good", you get …

Member Avatar for Narue
0
146
Member Avatar for SpS

>why is it printing oops Probably because you're mixing signed and unsigned types using negative values. That way lies madness.

Member Avatar for SpS
0
168
Member Avatar for SpS

>From where can i find the header file unistd.h... Start [url=http://www.linux.org/]here[/url].

Member Avatar for Narue
0
120
Member Avatar for hunanrostomyan

>But I don't think so that the problem is in goto. No, but goto doesn't buy you anything where a loop is better suited. >BUT, when I am writing the string again, it's not writing the first letter of that string into example.txt Add some prompts to your program. Your …

Member Avatar for Narue
0
166
Member Avatar for WrEcK

That question is very poorly worded. As far as I can tell, it basically means do this: [code] ofstream foutput ( "somefile" ); Worker w; w.printOut ( foutput ); [/code] By the way, if printOut doesn't use any member functions specific to ofstream, you could make it more general by …

Member Avatar for Narue
0
117
Member Avatar for yardog_1958
Member Avatar for Narue
0
87
Member Avatar for djbsabkcb

>Element* Stack::Element::Prev(void) How about: [code] Stack::Element* Stack::Element::Prev(void) [/code]

Member Avatar for Narue
0
147

The End.