5,237 Posted Topics

Member Avatar for Niner710

atoi is a C function expecting a char* Perhaps you need to implement a small conversion function which accepts a std::string instead.

Member Avatar for Tom Gunn
0
4K
Member Avatar for AutoC

Now why are you casting the result of malloc? Could it be that you didn't include stdlib.h and thus the compiler considers malloc as returning an int rather than a pointer? This can be a well hidden and very obscure bug. > I need an array of approx. 2,00,000 elements.But …

Member Avatar for Salem
0
166
Member Avatar for mytime19

[ICODE]s/a lot/10% tops/[/ICODE] You won't find a great chef who got where they are just by reading cookery books. Plus I guarantee you that most of them will have set fire to something at least once! Likewise, if your own programs haven't locked up the machine, caused a reboot, or …

Member Avatar for Salem
0
131
Member Avatar for shraddha_gupta

Well how do you run a single test case at the moment? How do you run several test cases? Is it typing in a somewhat repetitive command? Post some examples.

Member Avatar for Salem
0
59
Member Avatar for skelly16

sed -e "s/DATEST\/08/25[B][COLOR="Red"]/[/COLOR][/B]2009:07:41:41/g" One or more of the / in your dates needs escaping.

Member Avatar for skelly16
0
360
Member Avatar for homeryansta

> how do you do a square root in MIPS? Same as anywhere else, assuming you lack a library to do it - research algorithms (you've got google, do some searches) - write code - test code

Member Avatar for wildgoose
0
2K
Member Avatar for glyd
Member Avatar for glyd
0
112
Member Avatar for k007

If you don't know how many strings, then use a std::vector<std::string> instead of named variables. Something like [code] vector<string> fields; string temp; while ( getline(isstream,temp,'|') { fields.push_back(temp); } [/code] Then check fields[0] for whatever.

Member Avatar for k007
0
108
Member Avatar for cguan_77

Which OS? Which webserver? Which firewall? You know, basic information about your setup.

Member Avatar for cguan_77
0
144
Member Avatar for Frederick2

You've got [code] #include "somethingElse.h" #include "DoTestData.h" [/code] The last thing in somethingElse.h is the real cause of the problem, and it will be missing the ; in question.

Member Avatar for Frederick2
0
117
Member Avatar for Sune

Your struct contains strings. These are not simple objects, they contain pointers to where the data is stored (elsewhere). Simple write() functions don't know this. [url]http://www.parashift.com/c++-faq-lite/serialization.html[/url]

Member Avatar for Sune
0
149
Member Avatar for sam_inquisitive

And so it begins..... If someone isn't smart enough to think of a project to do, offering them a project title doesn't do anybody any good. First they can't think of a title, so you suggest one. Then they can't figure out what that means, so they ask you to …

Member Avatar for mytime19
0
159
Member Avatar for kaustubha.s

> hi i want to compile .c file as .cpp file using makefile!!. You'd better read [URL="http://david.tribble.com/text/cdiffs.htm"]Incompatibilities Between ISO C and ISO C++[/URL] then. Especially if you're naively assuming that C++ is a syntactic and semantic superset of C (neither of which is actually true).

Member Avatar for Salem
0
83
Member Avatar for guyod

> void processone(int delay); This is an int > processone(av[1]); This is a char* > void processone(char avinput) This is a char Making prototype AND definition a char* as well would go a LONG way.

Member Avatar for Salem
0
104
Member Avatar for DarkNova

It goes up when you call testmap(), but does it go up again when you call testvec() ? Using a process monitor to determine how much memory is in use can be misleading. When you delete memory in your program, it typically goes back into a pool of memory owned …

Member Avatar for ggsddu
0
2K
Member Avatar for Salem

Given the number of spammers (and other 1-posting drive-by's), how about designating certain threads as "fly paper". Fly paper threads have a high post count, and lots of buzz words, but are essentially useless to anyone who actually bothers to read them. If someone actually posts on them, they basically …

Member Avatar for ithelp
0
219
Member Avatar for pocketmaster

Which program? Is this something given by your tutor with the instruction "adapt this CD inventory program for cars". Or was it "write an inventory program for cars", and you just happened to find one for CDs, and decided to see if you could con someone else into converting it …

Member Avatar for ithelp
0
69
Member Avatar for chiraag

> My requirement is that I add a very small value of the order 10^-7 with a relatively big value, say 36.63 floats have about 6 decimal digits of precision, doubles about 15. 10^-7 is more than 6 digits away from [COLOR="Red"]3[/COLOR]6.63 so your really small number is effectively zero. …

Member Avatar for vali82
0
905
Member Avatar for JameB
Member Avatar for Natique

[url]http://msdn.microsoft.com/en-us/library/ms687393%28VS.85%29.aspx[/url] [quote=msdn] Note This function is provided only for compatibility with 16-bit Windows. [B]Applications should use the CreateProcess function.[/B][/quote] WinExec() is a cheap "fire and forget" approach. What you should be using (namely CreateProcess) gives you a lot more control over what is happening, and provides you with the necessary …

Member Avatar for Natique
0
196
Member Avatar for EvilOrange

Post some more code, for example all the other declarations of variables used in this code.

Member Avatar for EvilOrange
0
258
Member Avatar for thebluestar
Member Avatar for sara khan
Member Avatar for coud_ren_26

[url]http://www.daniweb.com/forums/announcement9-2.html[/url] There's a mine of information here [url]http://www.daniweb.com/forums/thread99132.html[/url] Try spending an hour or two trying to figure something out for yourself. Making a start, and getting stuck earns brownie points. Just dumping 1 liner of 0% effort doesn't. While I'm at it, [URL="http://www.catb.org/~esr/faqs/smart-questions.html#bespecific"]help me please[/URL] isn't a title for a …

Member Avatar for javaAddict
0
74
Member Avatar for tyliang

Open a file for writing (almost the same as you do for reading), and replace your printf() calls with fprintf() calls.

Member Avatar for jianna
0
120
Member Avatar for SeriousTyro

> I've learned Java, C++, and most recently C ( Fall of last year). But have you actually learnt how to PROGRAM yet? Learning a new language a year makes you an experienced "hello world" programmer. The world is knee-deep in these kinds of programmers. The real trick comes when …

Member Avatar for Salem
0
149
Member Avatar for umarmaqsood

> Accelerated C++: Practical Programming by Example Definitely a much better book than anything with "dummies" or "x days" or "guru" or any other kind of weasel words in the title. HOW to program is the real skill you should be working on, which will serve you well in decades …

Member Avatar for gkaykck
0
135
Member Avatar for gretty

> for (int j=0; j<6; j++) You're scanning the whole array, not just the valid values (that would be < i ) > if (match==0) Nothing resets this back to 0 for checking the next time

Member Avatar for Sky Diploma
0
127
Member Avatar for tyliang

Like so [code] #include <stdio.h> #include <string.h> struct student { char studName; int studID; char sex; char email; int mathsScore; int englishScore; int scienceScore; }; void readData(struct student data[]); void printData(struct student data[]); int main(void) { struct student data[20]; readData(data); // pass parameter printData(data); return 0; } void readData(struct student …

Member Avatar for tyliang
0
186
Member Avatar for Hugo Brand

[url]http://www.daniweb.com/forums/thread208776.html[/url] [url]http://www.daniweb.com/forums/thread211532.html[/url]

Member Avatar for Hugo Brand
0
41
Member Avatar for Majestics

> Urgent Help! This is neither [URL="http://www.catb.org/~esr/faqs/smart-questions.html#bespecific"]descriptive [/URL]nor [URL="http://www.catb.org/~esr/faqs/smart-questions.html#urgent"]accurate[/URL]

Member Avatar for Majestics
0
188
Member Avatar for jingo1126

mov ah,1h ; input number int 21h mov dl,0ah The result is returned in al [url]http://www.ctyme.com/intr/rb-2552.htm[/url]

Member Avatar for wildgoose
0
182
Member Avatar for pentiumpablo

Well how far ahead do you have to look to resolve the grammar?

Member Avatar for pentiumpablo
0
54
Member Avatar for bjohnst8

What you posted isn't C. Objective C is a very different animal, which not so many people are familiar with.

Member Avatar for bjohnst8
0
1K
Member Avatar for tyliang
Member Avatar for Dr.Unreal
Member Avatar for EvilOrange

> vararray[v+1]==NULL Well if vararray is an array of char, then testing the nul character (as opposed to the NULL pointer) is what you should be doing. As in [ICODE]vararray[v+1]=='\0'[/ICODE]

Member Avatar for Salem
0
101
Member Avatar for pymatio

So why the double open? [code] [COLOR="Red"]f = fopen(p, "w");[/COLOR] fprintf(f, ""); fclose(f); [COLOR="Red"]f = fopen(p, "a");[/COLOR] [/code]

Member Avatar for Salem
0
96
Member Avatar for jp071

Better yet, tell US what you found out, how you solved it and then mark it closed. Give something back.

Member Avatar for Salem
0
225
Member Avatar for raul14

> i have till wednesday(26/08) to finish it. Shouldn't that have read "YOU have until Tuesday 25/08 to finish it" ;)

Member Avatar for Salem
0
145
Member Avatar for Margu

> cout << "a1 is " << a1 << endl; The compiler (since it knows the value is const) is allowed to generate [ICODE]cout << "a1 is " << 40 << endl;[/ICODE] If you smash away the const-correctness of your program, then don't complain when the results bite you.

Member Avatar for Salem
0
134
Member Avatar for RemingtonSteele

Double what you had. The more capable it is, the longer it will last and the quieter it will be while it is running.

Member Avatar for RemingtonSteele
0
223
Member Avatar for osei-akoto

> a[l1+i] = 0; You didn't initialise i That means boom today (or boom tomorrow if you're unfortunate)

Member Avatar for Salem
0
76
Member Avatar for jasonjinct

EOF != feof() The former is a constant, and the other is a function call. Also, this would be better [ICODE]while ((fscanf (input, "%s %d %d", studName, &bioScore, &cheScore) ) == 3) [/ICODE] That is, a positive assertion of success, not a negative assertion of only one possible failure. I'm …

Member Avatar for Tom Gunn
0
484
Member Avatar for MiketheBook

Go for RAM. The extra processor speed (only about 10%) won't be worth squat if the system starts swapping excessively. But make sure the architecture would actually be able to USE 4GB of RAM. Intel 32-bit PC's typically can't use much past 3GB even if you put the RAM in …

Member Avatar for Salem
0
102
Member Avatar for want_to_code
Member Avatar for mps727

> but I don't know if it's a good idea to let them know I'm looking for another job Are you that set on finding another job? I mean, if your current employer offered you more money, a better desk, more responsibility, different project (or whatever), would you take it? …

Member Avatar for sknake
0
252
Member Avatar for PuntaGordaJohn

Is this a new development (a fault), or something it's always done (a feature)? Does it do this all by itself (isolated from network/PC etc), or only when you start windows (for example)

Member Avatar for Salem
0
114
Member Avatar for Ultratermi

You're assuming a) the network has zero latency, by calling recv() directly after send() b) that recv() will just stick around until a \r\n arrives - it won't. c) that recv() will add a \0 to the end of the buffer to make it a proper C string - it …

Member Avatar for Salem
0
298
Member Avatar for Ancient Dragon

Congrats AD :) > Now this is a marriage to be proud of Married 83 years, they have 186 descendants. A birthday to remember every other day - that's gotta be hard work. "What are you doing? Buying a present. Who for? Dunno, bound to be someone's either today or …

Member Avatar for Wasser
1
232

The End.