6,741 Posted Topics

Member Avatar for bpt0004

You miscopied the implementation, it's just a duplicate of the header, so I can't make any comments on your error except speculation. [B]>Why am i getting negative numbers and why is the iterations for rosenbrock just 1??[/B] I can't say why rosenbrock is 1, though with a name like rosenbrock, …

Member Avatar for Vash32291
0
111
Member Avatar for kkevin

[B]>so, please can anyone help me with this?[/B] Start by writing [i]something[/i], so we know you're actually engaging your brain and trying to learn rather than looking for freebies.

Member Avatar for Narue
0
63
Member Avatar for Rapmanseele

Do you know how to divide two polynomials on paper? If not, figuring it out before writing a character of code strikes me as the proper first step. You can't write code to do something you don't know how to do.

Member Avatar for Narue
0
49
Member Avatar for Privoxy

[B]>So the iostream allows for keyboard input[/B] At the risk of giving you too much information, there are several stages that your code goes through from source to executable. Here are the stages (bird's eye view): [list=1] [*]Source file: This is the stuff you write, exactly as you write it. …

Member Avatar for Narue
0
86
Member Avatar for electricangel

We have a forum for job offers. Perhaps you should post there instead of here.

Member Avatar for peter_budo
0
241
Member Avatar for stevenpetersen

[B]>why would you bad mounth someone for asking a questions.[/B] Can you be any more melodramatic, Mr. Drama Queen? As much as goody goodies like you want the world to run on sunshine and fairy dust, negative reinforcement is the quickest way to alter undesirable behavior. Compare and contrast: [QUOTE][B]Exhibit …

Member Avatar for stevenpetersen
0
539
Member Avatar for number87

>i cant figure out whats wrong with my loop I know what's wrong with your loop: It doesn't exist! Compare this with your existing program: [code=cplusplus] #include <iostream> using namespace std; int main() { int number, digitCount = 0; cout << "Enter an integer: " << endl; cin >> number; …

Member Avatar for taepodong1101
0
203
Member Avatar for MattyRobot

There's nothing wrong with it per se, but it's generally wiser not to confuse your readers with frivolous includes that aren't used in the file.

Member Avatar for MattyRobot
0
138
Member Avatar for HelloWorld23

Yes, you can. Go to Project and Properties, then somewhere in the myriad of options you'll see "Compile as C++" where you can change it to "Compile as C". And while you're at it, change the source file extension to .c instead of .cpp.

Member Avatar for shani443gb
-2
4K
Member Avatar for gerard4143

[B]>No the complier had no problems casting a void pointer to a function..should it?[/B] It might. Technically void* and functions pointers are incompatible and converting between them is undefined behavior. I've seen compilers give both warnings and errors for such a conversion. The good news is that you can avoid …

Member Avatar for gerard4143
0
133
Member Avatar for tasosa

The simplest solution is to store the unique values in a second array. For each value in the original array, if the value doesn't exist in the second array, store it. When you've exhausted all of the values in the original array, only the unique values will be stored in …

Member Avatar for tashfeen
0
239
Member Avatar for BestJewSinceJC

[B]>However, using code tags for something outside of code to achieve >a visual effect as a result of the current way code tags happen to be >handled cannot ever be guaranteed in the future.[/B] Translation: "Bite me. You didn't use tags for the narrow purpose they were designed, so you …

Member Avatar for cwarn23
0
392
Member Avatar for Sarang07

C doesn't specify tab stops, only tab characters. It's up to the program consuming those characters to interpret the character with a certain tab stop length, just like it's up to the same program to accurately print the 'Q' character. Translation: change the properties of whatever program is displaying those …

Member Avatar for Sarang07
0
90
Member Avatar for dmm

You can move the position (using seekg) either by an offset, or to a previous point (that was saved by tellg). Unless your file is very strictly formatted, you probably want the latter. So in your case, call tellg to get the file position before reading the fifth line, then …

Member Avatar for dmm
0
650
Member Avatar for Muathelbou

That's not what I would call "very difficult". You're also not likely to get any help by posting a homework assignment with no proof of effort. Show us that you tried to solve the problem first.

Member Avatar for tintin.iitk
0
227
Member Avatar for IT seeker

[B]>so tell me when u ll start to learn me ???????? i m wating [/B] I'll learn you good. Start by not being so impatient. Everyone has to start from nothing and work their way up to something. Being given solutions doesn't help you learn nearly as much as working …

Member Avatar for ithelp
-5
221
Member Avatar for jascase901

[B]>//doesnt work to my knowledge >int average(ifstream& file_in);[/B] The parameters and return type are not dependent. If that prototype doesn't work, it's because you did something else wrong. How about posting a complete program that fails?

Member Avatar for alg
0
147
Member Avatar for Carrots

The capacity of a container class has nothing to do with the OS, it's an internal mechanism of the C++ implementation. In other words, capacity will potentially return a different value for every single implementation of the standard library you use because the author of each library chooses how to …

Member Avatar for Narue
0
178
Member Avatar for Iam3R

[B]>i spent lot of time in googling but couldnot get it.[/B] Hmm, perhaps that's because it's copyrighted and any free PDF you find is [I]illegal[/I]? If you want the book that badly, go buy it. If you can't afford it or don't want to buy it, then do without. It's …

Member Avatar for Tom Gunn
-4
136
Member Avatar for spatel14

[B]>I would lookup random or srandom...for pseudo random functions in C [/B] Neither of which are standard functions, meaning unless the OP has the same compiler you do, the chances of your suggestion working are somewhat slim. srand and rand are the standard functions for seeding and generating random numbers.

Member Avatar for Chilton
0
133
Member Avatar for jlouang

When you say something isn't working, it suggests that the code even compiles, which it doesn't. Does this work the way you expect? [code] #include <iostream> using namespace std; int main() { int option; do { cout << " WYZ Company\n\n"; cout << " 1 - for loop\n\n"; cout << …

Member Avatar for IT seeker
0
173
Member Avatar for thebluestar

[B]>Please help me find the mistake![/B] I suspect the mistake is a complete failure to study whatever book on C you have. Instead of trying to finish this exercise in one swell foop, perhaps you should be writing a simple skeleton that passes structures around. At least that way you'll …

Member Avatar for Narue
0
205
Member Avatar for mar000m
Member Avatar for dibilasd
0
99
Member Avatar for zandiago

>What worked in cave man days is no longer workable. Then what would you suggest?

Member Avatar for BestJewSinceJC
0
889
Member Avatar for neithan

[B]>Google: the response to much and the answer to nothing.[/B] If you can't find complete information about I/O in C from google, you're either an idiot or a liar. It's easier just to say that you were too lazy to do a thorough search and need someone to point you …

Member Avatar for Narue
0
191
Member Avatar for MedianHansen

>[Linker error] undefined reference to `WinMain@16' You've created a project that's being built as a Win32 application. Those guys use WinMain instead of main as the entry point. If you want a regular C++ program, you have to choose the correct project type (which would be a console project of …

Member Avatar for SgtMe
0
939
Member Avatar for bluegoo06

[QUOTE=bluegoo06]i have a homework assignment using the calculatecharges function...we use C++...but my book doesnt have the actual usage for it in it. we have to calculate parking charges for cars in a parking garage...could someone please explain exactly how you would use this function to do that ... thank you[/QUOTE] …

Member Avatar for dydx
0
269
Member Avatar for mrrko

Read: [code=cplusplus] #include <fstream> #include <iostream> #include <string> int main() { std::ifstream in ( "file.txt" ); std::string line; if ( in ) { while ( std::getline ( in, line ) ) std::cout<< line <<'\n'; } } [/code] Write: [code=cplusplus] #include <fstream> int main() { std::ofstream out ( "file.txt" ); if …

Member Avatar for manojlogu001
0
152
Member Avatar for jamdownian

[B]>no help at all...but thanks anyway.[/B] Your capacity for patience is staggering. I mean, you couldn't even wait a full hour when it's either [B][I][U]SUNDAY[/U][/I][/B], or the wee hours of Monday all over the world. Good luck passing your class, and succeeding at a programming career, because you'll clearly need …

Member Avatar for jamdownian
0
137
Member Avatar for hongfan

>Something Like This Right, and that helps the OP delete an element from an [b]array[/b], how? >that removes an occurence of val in BBag? Just the first occurance, or all of them? The general process is to find the item, then shift everything after the item over it to fill …

Member Avatar for jeyson
0
525
Member Avatar for rasheed1982

>Then why don't you suggest another way. How about you figure it out instead of encouraging people to do the OP's homework.

Member Avatar for csurfer
0
132
Member Avatar for RohitSahni

>There is a Buit in function called getpass in conio.h Maybe on your compiler's flavor of C++. Just because it works for you doesn't mean it works for everyone, so at the very least mention your compiler and OS.

Member Avatar for shashanderson
0
241
Member Avatar for sonia sardana

>I also do not know what to write on the click event of the button. It's kind of hard to tell you what to write when I have no idea what you want the form to do. :icon_rolleyes:

Member Avatar for henry032
-1
587
Member Avatar for jephthah
Member Avatar for cwats124

[B]>Even though I am 8[/B] If you're 8 years old then you are in violation of Daniweb's policies (members must be at least 13 years of age). Therefore, I'll report this thread so that you can be properly banned for the next five years.

Member Avatar for pspwxp fan
-1
134
Member Avatar for dontcare

The entire program should be nested in your do..while loop: [code] int main() { int number, dig1, dig2, dig3; char answer; do { // Everything else in here } while ( answer != 'n' ); } [/code] And you should consider allowing 'N' as well as 'n' to be more …

Member Avatar for shubh93
-1
171
Member Avatar for Narue

Now that you've added this extra statistic, it would be nice to also include a search filter based on votes. For example, say I want to search for all of my posts that have been downvoted, or posts with more than one upvote. Currently I have to do a search …

Member Avatar for Dani
5
200
Member Avatar for Narue

Does the search algorithm use the current contents of the database, or a snapshot? Because I can do a search for something I know exists in a recent thread, but it doesn't show up in the results.

Member Avatar for Dani
0
202
Member Avatar for serkan sendur

>I don't understand why you're leaving after having a post deleted. Just another childish person stomping off in a huff when things don't go his way. The best way to deal with such pitiful theatrics is to ignore them.

Member Avatar for jasimp
-2
372
Member Avatar for arcticM

Amazing. You took the time to add underscores so that your formatting wasn't lost and didn't bother to look for some kind of forum tag that would preserve it for you? [B]>PLEASE help pps!![/B] Here's a hint: realloc only works on memory that was previously returned by malloc, calloc, or …

Member Avatar for arcticM
0
171
Member Avatar for sonygamer

>if(t=n) Note that in C++ the == operator is for comparison, = is for assignment.

Member Avatar for ashen77
0
151
Member Avatar for chunalt787

[B]>What is the difference between List and List_Info?[/B] The struct keyword. If you want to use List, the struct keyword is required. The whole point of typedefing a structure is to remove that requirement. Further, you can use the same name because structure tags and typedef names reside in different …

Member Avatar for chunalt787
0
152
Member Avatar for Covinus

>Surprising Salem didn't comment on this.. He probably doesn't want to explain it for the umpteenth time, like me.

Member Avatar for Tom Gunn
1
1K
Member Avatar for Behi Jon

We usually start by thinking about what we want. Then we might even draw it before working up a quick prototype. If the prototype meets out needs, we do the full implementation.

Member Avatar for Nick Evan
0
272
Member Avatar for Behi Jon

[B]>Is there a way to write a program in c++ that get a decimal number >and convert it to its equivalent in hexadecimal without using arrays ?[/B] Why yes, there is indeed a way. [B]>A bit guidance please ....[/B] I'm guessing that you refused to search the forum before posting …

Member Avatar for Nick Evan
0
158
Member Avatar for networkmancer

I suspect that if you fixed that piss poor formatting, you would easily find the problem. But noooo, you had to make it harder on yourself by writing code in a manner that [i]hides[/i] bugs.

Member Avatar for Ancient Dragon
0
242
Member Avatar for touqra

[ICODE]do[/ICODE] is a C++ keyword. That would probably hamper your ability to use it as an identifier.

Member Avatar for Narue
0
119
Member Avatar for vmanes

[B]>Your compiler will thank you for it.[/B] You mean your end users will thank you for it. What you described is called "Programming by Accident". It's a mindless approach to writing software that all programmers tend to default to because it's easier to do on autopilot. Unfortunately, too many professionals …

Member Avatar for Narue
1
99
Member Avatar for Narue

FASM can output an executable PE directly, but sometimes you want to output an object file for linking with modules in other languages. The following program can be used to link with the C library of the GCC compiler with the following commands: C:\>fasm hello.asm hello.obj C:\>gcc hello.obj -o hello.exe …

0
280
Member Avatar for Narue

Some languages are hard to get started in. FASM appears to be one of these languages because the documentation is not detailed enough for a beginner. That's a shame because FASM is (in my opinion) one of the better assemblers. The following snippet is a simple Hello, world! program which …

0
1K

The End.