5,237 Posted Topics

Member Avatar for Utter_iMADNESS

[url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044842972&id=1043284392[/url] Same principle for C You separate the implementation (in a .c file) from the interface (in a .h). Everything else includes just the interface, and the implementation is in just one place. Also, stop calling your C programs with a .cpp extension. That will just lead you astray.

Member Avatar for Utter_iMADNESS
0
97
Member Avatar for vidaj

> Why use a do loop ? It's one of the standard techniques to ensure that a multi-line macro such as this always appears as a single statement. See [url]http://www.c-faq.com/cpp/multistmt.html[/url] @OP [INLINECODE]>#define allocate_cube(type, var, x, y, z) \ > do { \ > (var) = malloc(sizeof(type **) * (x)); \[/INLINECODE] …

Member Avatar for jephthah
0
270
Member Avatar for asana.iyer

You need to compile both files, as in [ICODE]cc -o prog testtrp.c treap.c[/ICODE] Of course, exact details for your IDE will vary, but that's the essence of what you need to do.

Member Avatar for Salem
0
120
Member Avatar for purplegerbil
Member Avatar for Jishnu

> What should I do? Find another forum. Not that I'm suggesting you leave or anything, but you need to understand that no matter how great you think DW is, it's not the only show in town. A forum with 10K+ dedicated VB programmers would be a better place to …

Member Avatar for Jishnu
0
375
Member Avatar for phalaris_trip

> Every book I've read stresses the value of writing code with maintenance in mind, > but hey this is the real world, right and am I just being naive? Most real world software, especially commercial software is much better written. I think the problem you have is that the …

Member Avatar for TacklesMcCaw
0
395
Member Avatar for cecyl

Well there is [ICODE]std::sort[/ICODE], which will work on a [ICODE]std::vector[/ICODE] of integers. If you know what you're doing, it would take about 10 minutes to write - is that quick enough? Or how about using your command line sort program [ICODE]sort -k1n -o result.txt input.txt[/ICODE]

Member Avatar for vijayan121
0
128
Member Avatar for Hiroshe
Member Avatar for mikelle

Start with > Enter total acres: 12000 Which ends with "You entered 12000 for the acres" If you can't get the input right, the rest of the calculation just won't work. Break the problem down into small steps.

Member Avatar for Salem
0
116
Member Avatar for narendharg

The linker takes all your objects and libraries, and produces a relocatable program which can be executed by the OS program loader. The locator goes one step further and fixes the image at a specific address in memory. You would use a locator if you were say producing bootstrap code …

Member Avatar for Salem
0
90
Member Avatar for atsx05

1 down, 3 to go [code] void displayUserHeading ( void ) { // something here } int main ( ) { displayUserHeading(); return 0; } [/code]

Member Avatar for VernonDozier
0
119
Member Avatar for Muaz AL-Jarhi

> But i also have a bigger problem which is in the research itself. I only found like 2 or 3 articles. Well if it was real research, there should be ZERO papers. Not slapping together some half-assed result of a few google searches. > I haven't made any contributions …

Member Avatar for rgviza
0
115
Member Avatar for grvs

Well in main, you need to do this [CODE]int *result = readArray(size); printArray(result,size); free( result );[/CODE]

Member Avatar for grvs
0
5K
Member Avatar for grvs

> but as I am beginner in C/C++ Unfortunately, reading [URL="http://accu.org/index.php/book_reviews?url=view.xqy?review=c002173&term=c%2b%2b+reference"]schildt [/URL]books won't clarify the issue either. Pick a language and stick to it. Despite their recent common ancestry, and superficial similarity, using both of them well requires a C++ hat AND a C hat. C/C++ is just brain-damage. > …

Member Avatar for grvs
1
728
Member Avatar for FTProtocol

Other applications seem to manage it when they want user attention. So I'm going with "yes" as being the answer to your question, it is possible to do that.

Member Avatar for Ancient Dragon
0
91
Member Avatar for imtnan

Cut and paste works, as a bootstrap to get you going. If you have [ICODE][COLOR="Red"]int array[2][3][4][/COLOR];[/ICODE] and you want to pass that to a function, then you simply do [CODE] void myFunc ( [COLOR="Red"]int array[2][3][4][/COLOR] ); // prototype void myFunc ( int array[2][3][4] ) { // definition array[0][0][0] = 0; …

Member Avatar for dougy83
0
3K
Member Avatar for sanchit223
Member Avatar for Ancient Dragon
0
161
Member Avatar for amarjot

[url]http://clusty.com/search?query=mysql+c%2B%2B&sourceid=Mozilla-search[/url]

Member Avatar for Salem
0
55
Member Avatar for Jennifer84

I'm wondering something too. Like how are we supposed to guess which OS / Compiler / UI Toolkit you're using from just a few UI buzzwords scattered through the post and 2 lines of code.

Member Avatar for Jennifer84
0
436
Member Avatar for niitian

Perhaps begin with a simple program which reacts to single key presses. Then write another program to implement the basic queue data type. Then come back to us.

Member Avatar for Nick Evan
0
159
Member Avatar for Ancient Dragon

And you'd still get posts in it from the Turbo C luddites as well. Most of the time, they don't have a clue what their question is. Is it an OS question, a C++ question, a compiler question or an API question?. They just scan the forum titles (ignoring the …

Member Avatar for Ancient Dragon
0
135
Member Avatar for Salem
Member Avatar for Lardmeister
0
98
Member Avatar for nathan.petrelli

Or we simply don't care enough. Basically, saying [URL="http://www.catb.org/~esr/faqs/smart-questions.html#urgent"]urgent[/URL], dumping your assignment and not putting forward any [URL="http://www.daniweb.com/forums/announcement125-2.html"]demonstration [/URL]of what you've tried so far pretty much guarantees most people will go and find more worthy people to help first. I'm only posting this because it's my last post of the …

Member Avatar for Colin Mac
0
182
Member Avatar for awi123

So what's YOUR question? Mine is "Why haven't you read the intro posts on how to use code tags?"

Member Avatar for Aia
0
113
Member Avatar for azualin

Yes, we all can solve it. The question is, are you going to attempt it yourself first? That's what the intro thread tells you.

Member Avatar for Radical Edward
0
65
Member Avatar for chickenlord500
Member Avatar for SirDorius

SS means stack segment. EBP typically moves around with ESP (BP=Base Pointer, SP=Stack Pointer). The BP is typically used to establish a fixed point of reference for a stack frame. BP + offset would typically be parameters, BP - offset would be local variables and temporary storage.

Member Avatar for SirDorius
0
129
Member Avatar for rajkiran718

[url]http://curl.haxx.se/libcurl/[/url] Would take care of a lot of the lower level details of HTTP.

Member Avatar for stephen84s
0
111
Member Avatar for krammer
Member Avatar for ghostdog74
0
202
Member Avatar for sana bangash

It's a confusing time jwenting ;) On the one hand, they're looking for a nice easy project they can hand in for maximum marks with minimal effort. On the other, they have to maintain the illusion that the difficulty level is within the scope of their meagre skills, and it …

Member Avatar for hammerhead
0
124
Member Avatar for daviddoria
Member Avatar for timbo2000

If you have a.h b.h c.h And you include a.h, what exactly are you hoping to achieve with the other header(s) ?

Member Avatar for timbo2000
0
93
Member Avatar for LarissaMelissa

Do you want a foot massage while you're waiting? Enter the [URL="http://www.daniweb.com/forums/announcement125-2.html"]relaxatron here![/URL]

Member Avatar for Salem
0
43
Member Avatar for LightSystem

[code] struct uservar { struct uservar *next; char *userVarName; int userVarValue; } [/code] When you want to create a new one, allocate one of the above, complete the name (and value), and append to a list. When you want to look up the user named variable, search the list. etc …

Member Avatar for Salem
0
77
Member Avatar for QuantNeeds
Member Avatar for Salem
0
123
Member Avatar for merkuries

Very good, now read all the intro threads and figure out what all that "how to post code" is all about.

Member Avatar for merkuries
0
172
Member Avatar for hazmatt

> The original code takes in a url as an argument. The first argument will be argv[1]. argv[0] is traditionally the program name. Also, rather than assuming that argv strings can be modified, just make a copy of it in a variable you KNOW you can modify. It's not like …

Member Avatar for hazmatt
0
127
Member Avatar for dr4g

[icode]email client <---> [COLOR="Red"]filter [/COLOR]<---> SMPT server[/icode] Rather than connecting directly to mail.myisp.com, you connect to 127.0.0.1 and the filter then connects to mail.myisp.com Your filter looks like an SMTP server to your normal email client, and looks like an email client to your ISP's mail server. The filter sees …

Member Avatar for Salem
0
103
Member Avatar for marizion

1. You didn't mention which tutorial you read, so we don't know whether it was any good or just some 10+ year old hack for an older operating system. 2. You didn't say which OS/Compiler you're using now. 3. You didn't show us the code you tried. > if you …

Member Avatar for marizion
0
130
Member Avatar for sameeha
Member Avatar for cam9856

But "Fred Flintstone" reads as "Fred Flintstone" to anyone smart enough to use a hex editor. Sure, if you write enough other binary data along with it, most simple text editors will barf on the file, but no hex editor will. You could try encrypting the file, but by necessity, …

Member Avatar for cam9856
0
143
Member Avatar for iansane

Why not simplify, and just write the whole file? Unless you're incrementally adding (always) to a file which is many megabytes in size, this isn't going to take much longer than any other approach. Or how about a boolean, which records whether a header exists in the file (or not). …

Member Avatar for Duoas
0
142
Member Avatar for carobee

It's Sleep(), note the capital 'S', and it's in windows.h. It counts in milliseconds.

Member Avatar for Colin Mac
0
144
Member Avatar for mariaczi_pl

I know that you didn't read - [url]http://www.daniweb.com/forums/forum8.html[/url] or - [url]http://www.daniweb.com/forums/announcement8-3.html[/url] or - the watermark at the back at the edit window. Had you done so, your post would have been readable, and not riddled with smilies, formerly known as scope operators.

Member Avatar for mariaczi_pl
0
175
Member Avatar for QuantNeeds

1. 13! overflows an int. So unless you're keeping to really small values, expect trouble here. 2. (numerator/denominator) If both of these are ints, the result is integer division (truncation towards zero, result is an integer). Cast one of them to double before dividing, not afterwards.

Member Avatar for QuantNeeds
0
615
Member Avatar for Aamit

[url]http://clusty.com/search?query=how+to+create+a+windows+service&sourceid=Mozilla-search[/url]

Member Avatar for mitrmkar
0
492
Member Avatar for mewhocorrupts
Member Avatar for zoner7

[QUOTE=joshmo]> why dont you do something like this > if (x == "EASY" || "easy" ) [/QUOTE] You've written (with red bits for clarity) [ICODE]if ( [COLOR="Red"]([/COLOR] x == "EASY" [COLOR="Red"])[/COLOR] || [COLOR="Red"]([/COLOR] "easy" [COLOR="Red"]!= NULL )[/COLOR] )[/ICODE] In essence, it's always true, because the right hand side is always …

Member Avatar for Cybulski
0
328
Member Avatar for kartik14

You only need the [ICODE]extern "C"[/ICODE] if you're mixing C and C++. If it's all C++, then [ICODE]extern [/ICODE]should be fine. Post actual code and error messages if you're still stuck.

Member Avatar for vijayan121
0
147
Member Avatar for bookworm619

Well the implication from the text is that argv[1] is the "document???.cry" file. How about posting the code which verifies that an argument exists and then goes on to open the file and read it's contents (much like you do with cin at the moment).

Member Avatar for Radical Edward
0
144

The End.