6,741 Posted Topics

Member Avatar for aminit

>Here's one possible way to get desired string2: It's generally considered rude to provide a complete solution when the OP hasn't shown any proof of effort. >#include<iostream.h> This header is no longer valid C++. Many newer compilers will refuse to compile it, and some of them have done so for …

Member Avatar for amitahlawat20
0
120
Member Avatar for CBarr

>Does it have something to do with the braces being gone off of the else? You got it in one. If you omit the braces, only the next statement will be a part of the block. If you add braces in the way that your compiler parses the code, it …

Member Avatar for CBarr
0
94
Member Avatar for Majestics

Yes, though I get the feeling you were trying to reply to a thread and accidentally created a new one. Look up the stringstream class.

Member Avatar for Majestics
0
73
Member Avatar for skatamatic

>I know there must be a way to do it... There's not a way to do it. Structures have a set size at compile-time. However, I get the impression that you simply don't know how to express your problem and ended up asking for something impossible. It looks like you …

Member Avatar for skatamatic
0
115
Member Avatar for majestic0110

>how can one find the upper limit of an array? Assuming the upper limit in terms of capacity, you can use the Length property. my_array.Length gives you the number of items the array can hold, and my_array.Length - 1 gives you the last valid index. >ow can one change that …

Member Avatar for majestic0110
0
237
Member Avatar for gothicmisery85

And what do you want us to do? We're not going to write this program for you, so if you want some help, you'll need to show that you've made an attempt.

Member Avatar for gothicmisery85
0
238
Member Avatar for Jennifer84

>how it is possible to remove "dublicates" from Values(6) ? I'd start by sorting the vector and calling std::unique on it. Of course, that's mentally translating "dublicate" into "duplicate". If you really do mean "dublicate", I have no idea what you're talking about.

Member Avatar for Jennifer84
0
346
Member Avatar for dupontmika

Daniweb isn't your personal homework service. Go to rentacoder.com if you want cheap labor.

Member Avatar for Narue
0
35
Member Avatar for maggz

So...did you even try to understand and correct the errors you're getting before posting all of that (without code tags)?

Member Avatar for Narue
0
288
Member Avatar for Lensva

>iMas=new int(m); You need to use square brackets instead of parens: [code=cplusplus] iMas=new int[m]; [/code] >for (int i=1; i<=m; i++) Arrays are zero-based in C++. That means you start at 0 and stop at n - 1 or you'll be accessing memory that you're not allowed to access: [code] for …

Member Avatar for Lensva
0
93
Member Avatar for amitahlawat20
Member Avatar for gast74830

Not portably. If you want to know about non-portable methods, tell us your OS and compiler.

Member Avatar for Narue
0
68
Member Avatar for asadullah

Thanks for the tips. However, I'm going to disagree with them to an extent. >How to make your program to be fast. Don't waste your time with micro-optimizations. Instead, focus on algorithms and I/O. That's where the big wins in performance are found. >1. Use Pre Increment or Pre Decrement …

Member Avatar for Narue
0
354
Member Avatar for Jennifer84

You can use the Application class from System.Windows.Forms (assuming we're talking about C++/CLI): [code=cplusplus] Application::Exit(); [/code]

Member Avatar for Jennifer84
0
100
Member Avatar for begyu

You have a type mismatch: [code=cplusplus] RvX += RotMatrixX[i][k] * vec[k]; rvec[i] = RvX; [/code] In the first line, vec[k] is a vector, not a float. There's no defined conversion from vector to float in your code, and you don't define a specific operator* to handle (float * vector). Most …

Member Avatar for Narue
0
149
Member Avatar for ravipawar1

We have a list of recommended books [url=http://www.daniweb.com/forums/thread70096.html]here[/url].

Member Avatar for codeaa
0
81
Member Avatar for amitahlawat20

For starters, you aren't properly initializing your row and col data members. Second, you aren't properly copying your objects and end up trying to access freed memory.

Member Avatar for Narue
0
80
Member Avatar for teked

>i.e. * before / etc Multiplication and division have the same precedence. >i dont know how to get the code to look at each operand in a string of chars. You would save yourself a lot of trouble by using a stack to either build a parse tree, or convert …

Member Avatar for priyad2
0
166
Member Avatar for jeffige

Is this a compilation warning or error? I'm not sure I understand what you mean by "I get this file popping up...".

Member Avatar for jeffige
0
344
Member Avatar for zmnaiaj30

You might as well be speaking gibberish if you don't provide the context for your question.

Member Avatar for Ancient Dragon
0
124
Member Avatar for cs_tx_usa

>I have posted 3 threads requesting help on reading floating >point values from a binary file but did not get any reply at all. So you've flooded the forum with threads asking the same question? That alone will cause people to ignore you. >Following code just throws an exception What …

Member Avatar for cs_tx_usa
0
214
Member Avatar for piers

>Something I have noticed with my uni course is that there are so few women on it. That's typical. >Is there some reason why women stay away from the >best part of using a computer IE programming in java? Maybe they don't know that the best part of using a …

Member Avatar for neocoder
0
350
Member Avatar for daviddoria

>Is it possible to make a function with an unknown number >of parameters without knowing ANY of them? No, C++ requires at least one non-variable parameter so that the stdarg macros know where to hook the beginning of the parameter list. >doesn't make sense that this functionality has been removed …

Member Avatar for Ancient Dragon
0
93
Member Avatar for see_sharp
Member Avatar for BlackSun
0
69
Member Avatar for eranga262154

When I write a Windows Service, I typically use XML configuration files for communication between the service proper and any auxiliary applications (such as detailed configuration of the service).

Member Avatar for JerryShaw
0
111
Member Avatar for bwjones

>Should I use an array to do this? Sounds good to me. You need to store the count somewhere, and an array keeps the three counts neatly organized under one object.

Member Avatar for bwjones
0
187
Member Avatar for morb

>Why do we use memory heap to allocate classes, but not built-in types (int, char etc.)? Bad question. Sometimes objects are better placed on the "stack", and sometimes they're better placed on the "heap". Provided the language doesn't force you into one or the other for internal reasons such as …

Member Avatar for morb
0
90
Member Avatar for mank

1) I'm not sure what you're asking. Are you talking about hiding a variable by using another variable of the same name in a nested scope? [code=c] #include <stdio.h> int main ( void ) { int foo = 10; { int foo = 20; printf ( "foo = %d\n", foo …

Member Avatar for mank
0
83
Member Avatar for maui_mallard

>I've missed something somewhere that tells us all about reputation. To the best of my knowledge, the only explanation about reputation is by Dani, in the feedback forum, in direct response to a confused poster who couldn't find an explanation about reputation. ;) I still don't understand the details myself.

Member Avatar for Lardmeister
0
321
Member Avatar for farag

>How can i write comment in professional way to explain my code Copied from my reply to a similar question on cprogramming.com: The way I explain commenting to my team is that any given piece of code causes you to ask one of three questions: 1) "What is it doing?" …

Member Avatar for Dave Sinkula
0
142
Member Avatar for 31N513N

>use selsort "How do I cross this creek without getting my feet wet?" "Use a 747 to fly over it."

Member Avatar for JRM
0
111
Member Avatar for zandiago

>wouldn't it qualify as libel instead? Libel is written, slander is spoken. But I'm more inclined to treat a forum discussion as a spoken exchange, thus slander is the correct term in my opinion.

Member Avatar for jbennet
0
640
Member Avatar for Alexandros

What have you tried? This is a very basic and simple program, so you're expected to at least have something resembling a solution. It doesn't have to work, but it does have to look like you tried.

Member Avatar for Narue
0
73
Member Avatar for ankitbullu

>What enables C to support variable number of function arguments (varargs) Usually arguments are placed on a stack, and by knowing how that stack is organized, the compiler writer can write macros to iterate over the arguments. It's actually pretty simple, but very non-portable. >What is special in C which …

Member Avatar for Narue
0
84
Member Avatar for farag

Let's start with the first problem and see how that goes. Unless you're using a compiler that supports export (you probably aren't), templates can't be split into separate declaration and definition files. You have to provide the definition of the template in the header.

Member Avatar for farag
0
158
Member Avatar for zandiago

Life isn't fair. Personally, I'm wondering why you chose CEOs to bash for making obscene amounts of money and not professional athletes or actors.

Member Avatar for briansmall
0
394
Member Avatar for wollacott

FYI, this type of post is a good way to be ignored: [quote] can you help me? <complete text of a homework assignment> [/quote] It suggests that by "can you help me?", you really mean "can you do it for me?". We're not a homework service, so prove that you've …

Member Avatar for DangerDev
0
78
Member Avatar for akrai_9

[url=http://eternallyconfuzzled.com/arts/jsw_art_bigo.aspx]This[/url] might help you get started. Little-o isn't used very often in computer science, so you'll find yourself sticking to just O, Omega, and Theta.

Member Avatar for Narue
0
54
Member Avatar for AMARJEET DUA

What do you know about working with bits? Do you know how to set them and shift them?

Member Avatar for Narue
0
146
Member Avatar for smiles

>You should return NULL (in CAPITALS), then it should return 0 No, you shouldn't use NULL except in a pointer context because it's allowed to be (and often) defined thusly: [code=c] #define NULL ( (void*)0 ) [/code] If you want to return a null character, return '\0'.

Member Avatar for VernonDozier
0
106
Member Avatar for mario123

>Is the advice different for devices that do not necessarily have an operating system. Freestanding implementations are excepted from a lot of the rules of hosted implementations. But since a programmer on a freestanding implementation is highly unlikely to be asking this question, and int main is always correct, the …

Member Avatar for Narue
0
404
Member Avatar for prs55

>i am confused what do i need to return?? It returns DataType. DataType is the type of the data that the list holds, so you'd return the data at the Nth node. Using your notation: [code=cplusplus] template <class DataType> DataType OrderedList<DataType>::get(int n) const { NodePointer nPtr = first; // Find …

Member Avatar for prs55
0
105
Member Avatar for saketbash

Pure speculation, but maybe 10 grades per line, 5 lines per field, and each field separated by a blank line: [code] x x x x x x x x x x x x x x x x x x x x x x x x x x x x x …

Member Avatar for saketbash
0
166
Member Avatar for sonygamer

>You're comparing colorCode to a character but defining colorCode as an integer! Not a problem. char is an integer type and int can hold any value in the basic character set.

Member Avatar for Narue
0
1K
Member Avatar for saketbash

>inFile.open("input.txt"); >outFile.open("output.txt"); Let's start here. You're not checking to see if the files were opened successfully. All kinds of gremlins can pop up if you use a file stream that failed to open. >//Read input file and store into array >while(gradeArray[i] != SENTINEL) You never initialized gradeArray, so gradeArray[i] is …

Member Avatar for saketbash
0
88
Member Avatar for timchippingtond
Member Avatar for Narue
0
147
Member Avatar for swetha bandaru

>ON another note this is depreciated. Do you mean deprecated? If so, you're wrong. If not, please elaborate.

Member Avatar for Narue
0
424
Member Avatar for gyanu

That looks like a healthy mix up of scanf and printf. Why are you trying to do padding in scanf? That code is actually quite awful, so you probably want to redesign and rewrite it. I get the impression that this isn't your code, so I'll give you a better …

Member Avatar for Narue
0
145
Member Avatar for Jboy05

>What is the output for a and b? Run it and see. >Why is a 3 and b 2 is this one 2 + 3 = 5 5 - 3 = 2 5 - 2 = 3

Member Avatar for VernonDozier
0
79
Member Avatar for Jennifer84

>What I want to do is to put each line into an Array. [code=cplusplus] array<System::String^>^ a = gcnew array<System::String^> ( textBox1->Lines->Length ); a = textBox1->Lines; [/code]

Member Avatar for Jennifer84
0
340

The End.