6,741 Posted Topics

Member Avatar for tommy1988

The best is the one that works best for your needs. Try out several, there are quite a few free ones you can use to get a feel for what features you want.

Member Avatar for Raven11
1
117
Member Avatar for tw0nk

When an array name is used, it is usually converted to a pointer to the first element. This only works for the [b]first[/b] dimension, so you're actually passing a pointer to an array of size dimensions, not a pointer to a pointer to float.

Member Avatar for Narue
0
84
Member Avatar for blackdove

>void main() This is not, and never has been, correct C++. main returns an integer. >int display_array(int array[], int& size) I notice that size is never modified, so the primary reason for passing a non-const reference doesn't apply. Because a reference is usually the same size as an int or …

Member Avatar for blackdove
1
151
Member Avatar for kevin_smithers

>because of personal reasons That's against the rules. None of the moderators (to my knowledge) would ever consider locking a thread for personal reasons. >because you are an advocate of Microsoft What does Microsoft have to do with C++ dying a slow death?

Member Avatar for Narue
0
264
Member Avatar for sgbartley
Member Avatar for dv916
Member Avatar for Narue
1
943
Member Avatar for freesoft_2000

>Don't forget to read the Microsoft bashing jokes Microsoft bashing is cliche and annoying. Don't people have better things to think of and link to?

Member Avatar for jwenting
0
239
Member Avatar for Raven11

Off the top of my head I would say it's not easily possible unless you set up the calling program to run as a unique user. Then you could check to see what user owns your program's process (such as with ps) and terminate if it isn't the right one.

Member Avatar for 1o0oBhP
0
304
Member Avatar for Asif_NSU

Is there any reason this has to be an interactive file rather than an interactive terminal session that writes to a file periodically?

Member Avatar for Narue
1
259
Member Avatar for Tetsu

I'm not quite sure what you're asking. Do you want to stop reading scores for that name at the first negative number? If so, why does your example have a score after a negative number and not a name? If not, what is a negative score supposed to mean? Given …

Member Avatar for Tetsu
0
192
Member Avatar for nanosani
Member Avatar for nanosani
0
881
Member Avatar for Tripoli178

So you want to add a new feature without doing any work? ;) Since the data is already in a file, the path of least resistance is to send it to the spooler by way of a system command: [code] case ON_LEFT_CLICK: system ( "print test.txt" ); break; [/code]

Member Avatar for Narue
0
117
Member Avatar for dal4488
Re: help

Compare and contrast: [code] #include <iostream> using namespace std; int main() { int even = 0, odd = 0; int input; cout<<"Enter a set of numbers: "; while ( cin>> input ) { if ( input % 2 == 0 ) even += input; else odd += input; } cout<<"Even: …

Member Avatar for dal4488
0
173
Member Avatar for arikeri
Member Avatar for Narue
0
73
Member Avatar for crypter

To summarize, you want to know how to write a robust program. Unfortunately, that's an art that takes experience and practice. There aren't really any tricks to it. Just know what errors could possibly happen and write code to handle them gracefully (such as with try..catch blocks).

Member Avatar for crypter
0
130
Member Avatar for arikeri

>but why? Have you ever tried to convert a complex algorithm written in Pascal to C? ;)

Member Avatar for Dave Sinkula
0
231
Member Avatar for Acidburn

What version of Borland? Is it command line or IDE? All compilers support multiple files and search for .h as a default header extension, so most likely you're doing something wrong.

Member Avatar for Narue
0
108
Member Avatar for riturajraina

>segment _TEXT exceeds 64 k Your program is too big. This has nothing to do with how many variables you use at once or how much dynamic memory is allocated. The machine code instructions and related information after compiling exceeds the limits of your implementation. Trying to fix this would …

Member Avatar for Narue
0
252
Member Avatar for geoff_2005
Member Avatar for murgi666
Member Avatar for dello

Think in terms of rows of records consisting of fields instead of rows and columns: [code] in = fopen ( "data1.txt", "r" ); if ( in == NULL ) { /* Error */ } else { int i, j; do { fscanf ( in, "%s", dummy ); if ( strcmp …

Member Avatar for dello
0
227
Member Avatar for hopeolicious

>this is a quote taken from my text book Your textbook misspelled sentence? strtok is fine if you understand that it modifies the original string. This means that if you need the original for anything later, you need to make a copy first, and if the original string is const …

Member Avatar for Acidburn
0
448
Member Avatar for Ghost

>learn proper OO techniques That I can understand. >proper Java class naming Sun recommends a style for Java, but that doesn't mean it has to be used. I disagree with several of their recommendations and thus, don't use them. As long as the style is consistent, anyone should be able …

Member Avatar for paradox814
0
91
Member Avatar for Tetsu

I assume by acute you mean equilateral. It's terribly difficult to get all of the acute trianglesto print accurately using command line output. Instead of one nested loop, try two. The first nested loop should handle spaces and the second should handle asterisks: [code] for i = 0 to N …

Member Avatar for Narue
0
263
Member Avatar for baboon4000

Try again, this time with a complete, understandable sentence.

Member Avatar for Dave Sinkula
0
223
Member Avatar for fastcarz3

[QUOTE=guest][COLOR=Red]he ha ha ha ha ha ah aha aha aha aha haa ha ha ha ha ha ha aha ha aha ahja aha ha ah [/COLOR] [SIZE=4]1[/SIZE][FONT=Comic Sans MS]1[/FONT] :rolleyes: :p :lol: :mad: :( :mrgreen:[/QUOTE] Please refrain from bumping two year old threads.

Member Avatar for Narue
0
646
Member Avatar for Fasola

>every program we wrote would excute some programming by inputing data >or outputing data on a black "DOS" looking screen. I make a good living doing just that. In fact, I've never written a GUI or any graphical component. It's funny how everyone seems to think that they're not really …

Member Avatar for Fasola
0
314
Member Avatar for tyczj

>"error c2447: missing function header (old-style formal list)" And the line of code that goes with this error? Clearly you're trying to do something that looks something like a K&R style function definition, but C++ doesn't allow those.

Member Avatar for Narue
0
170
Member Avatar for Nauro

>So I can just change the one entry? Yes, but only if the entry or record is a fixed length. Otherwise you risk overwriting the next entry. Can you describe the format of your file? That's a huge factor in how you read from and write to it.

Member Avatar for Narue
0
294
Member Avatar for kharri5

It looks fine, though what happens if you have a one or two node tree here? [code] return isBST(r,r.left.key, r.right.key); [/code] It would be better to come up with some sentinel min and max value to pass to isBST rather than requiring the tree to have at least three nodes.

Member Avatar for Narue
0
104
Member Avatar for dallin

>You need a bubble sort algo. Please don't suggest bubble sort if other options are available.

Member Avatar for Narue
0
327
Member Avatar for shock1

>double powerTo(double, int){ You need to name the parameters as they're declarations, not placeholders. >if(int < 0){ How could the type int be compared with a value of type int? [code] /* x to the nth power */ double powerTo ( double x, int n ) { double ret = …

Member Avatar for Narue
0
150
Member Avatar for Kaone

As much as we love to read line after line of unformatted code, please use code tags. I've added them for you this time.

Member Avatar for Narue
0
303
Member Avatar for freesoft_2000

Draw a filled rectangle that's n pixels bigger than the image, then draw the image over it. The effect is an n pixel rectangle around the image.

Member Avatar for Narue
0
99
Member Avatar for Iamhere

Iamhere: This is your first official warning. Don't post multiple threads with the same question. If you keep doing it, I'll be forced to take disciplinary action. If you find you forgot to add something to your post, you can edit it. Also, please use [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#code]code tags[/url] when posting any …

Member Avatar for Narue
0
107
Member Avatar for Iamhere

Can you rephrase your question? Don't put it in a comment, describe it thoroughly outside of your code snippets. Preferrably with examples of the input and output you want.

Member Avatar for Narue
0
99
Member Avatar for hopeolicious

You have quite a few problems. Compare this with what you have and see if you can find them: [code] #include <iostream> using namespace std; void sort ( int a[], int n ); int main() { const int LIMIT = 5; int array[LIMIT]; cout<<"Enter "<< LIMIT <<" numbers: "; for …

Member Avatar for Narue
0
109
Member Avatar for atul8486

I've posted a [url=http://cboard.cprogramming.com/showthread.php?s=&postid=217303]reply[/url] to this question that has proven useful to others before. Maybe you can get some ideas from it.

Member Avatar for Narue
0
157
Member Avatar for trevs234
Member Avatar for Narue
0
104
Member Avatar for Juliane123

There are basically two ways to ensure that no number is repeated. The first way is to randomly permute a list of numbers with no duplicates. Then you can just ask for n numbers from that list and they should be fairly random: [code] public class scratch { public static …

Member Avatar for Narue
0
1K
Member Avatar for kloony

>I figured that it probably was due to the system running out of memory to allocate No, not directly at least. You can get a segmentation fault because malloc failed and returned a null pointer, but the system running out of memory (while incredibly unlikely) wouldn't result in a seg …

Member Avatar for kloony
0
356
Member Avatar for Chadmo

A good start is something along these lines: [code] #include <iostream> using namespace std; int main() { int n; while ( !( cin>> n ) && !cin.eof() ) { cerr<<"Invalid input"<<endl; cin.clear(); cin.ignore ( cin.rdbuf()->in_avail() ); } if ( !cin.eof() ) cout<<"You entered "<< n <<endl; } [/code] It still …

Member Avatar for Narue
0
104
Member Avatar for tat2dlady

>char FirstCharacter[1]; // Character string to hold to value found by This must be an empty string or it cannot be a string at all. C-style strings require a null character at the end as a terminator. You would really be better off just using a single char. >if (FirstCharacter[0] …

Member Avatar for tat2dlady
0
124
Member Avatar for dallin

Is there any reason you're using inheritance when a few non-member functions for String would work just as well with less work?

Member Avatar for dallin
0
93
Member Avatar for new comer

>i have just got my self a Borland 4.5 from ebay You got ripped off, no matter what you paid for it. Borland 4.5 is too old to be useful these days, and Borland gives away their 5.5 compiler for free. >like to be able to put a shoping cart …

Member Avatar for vegaseat
0
154
Member Avatar for xfruan

Multidimensional arrays are actually arrays of arrays, so you need to allocate memory to reflect that: [code] char **p = new char*[rows]; for ( int i = 0; i < rows; i++ ) p[i] = new char[cols]; [/code] Then to free them: [code] for ( int i = 0; i …

Member Avatar for Narue
0
109
Member Avatar for Iamhere

This is the third time you've asked the same question, maybe no one here can help you, but then again, maybe you're asking the question wrong. I'll leave this thread unlocked on the off chance that some kind soul wants to tell you what's wrong about your question.

Member Avatar for Dani
0
240
Member Avatar for trevs234

I've added code tags for you this time. Please review [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#code]this page[/url] before posting again, and be sure to use code tags when posting code.

Member Avatar for vegaseat
0
161
Member Avatar for SyLk

Start at array.length - 1 instead of 0, and make sure that you don't actually access the -1th index. ;)

Member Avatar for Narue
0
243
Member Avatar for Maple_Tiger

>I'm not sure if I should click on compile or build. A missing brace is a syntax error. You can get that during the compile stage, so either Compile or Build will work because Build compiles first, then links.

Member Avatar for Maple_Tiger
0
177

The End.