6,741 Posted Topics

Member Avatar for rajunair

Are you high? What makes you think anyone but God can help you with a question like that?

Member Avatar for Narue
-1
52
Member Avatar for NichtSoGut

[B]>And in relation to the code I posted, why couldn't I have the '\n'?[/B] If there's whitespace in the format string, scanf will extract whitespace characters ([i]any[/i] whitespace character, so '\n' is no different from ' ' or '\t' in both the stream and the format string) until the next …

Member Avatar for Narue
0
115
Member Avatar for serkan sendur

[B]>i,ROBOT >Will Smith fights a robot conspiracy to break the >"a robot can't harm a human" union rules.[/B] Read Asimov's short stories under the same name. You'll be even more impressed than some cheesy action knockoff could offer. I, Robot and I am Legend are two good examples of the …

Member Avatar for ronnieaka
0
1K
Member Avatar for bufospro

Endianness is about byte order, not bit order. So 00000000 00000000 00000000 00000011 in little endian is 00000011 00000000 00000000 00000000 in big endian. Keep that in mind when doing your conversions.

Member Avatar for bufospro
0
100
Member Avatar for hiddepolen

The cast to a wide string type should raise red flags. Perhaps you should consider wchar_t and swprintf from the get-go instead of trying to drop narrow characters into wide holes and hoping for magic.

Member Avatar for hiddepolen
0
133
Member Avatar for kyros

[B]>I saw this question in a site and tried to solve this but I have no idea can you help me?[/B] If you tried, then show us your attempt and what you learned from the failure. This is pretty close to the easiest of recursive problems, so I'm inclined to …

Member Avatar for Lerner
0
171
Member Avatar for timdog345

Sorry, but you're going to have to fix the formatting of your triangles. I added code tags to preserve the spacing, but it looks like you used Daniweb's input box to format everything. The input box doesn't use a fixed width font type, so what looks good when you type …

Member Avatar for coldzero_82
1
119
Member Avatar for myk45

[B]>i would like to know more about the book before i buy it.[/B] FYI, TAOCP consists of several volumes, and it's concentrated awesome. If I could only keep one of my books (I have many), it would be TAOCP (probably volume 3). [B]>Reviews as to how the Math in it …

Member Avatar for myk45
0
108
Member Avatar for yaya

>the solution i need to obtain is >sum[i] = A[i][j] + B[i]; What are the types of A, B, and sum? I really don't see what the problem is unless A[i][j] and B[i] are incompatible for addition, or sum[i] can't hold a value of the result.

Member Avatar for somnath Basak
0
161
Member Avatar for vegaseat

TCL is a fun language...not as fun as Perl though. ;) Try [url=http://www.tcl.tk/]this site[/url].

Member Avatar for gwmorris
0
3K
Member Avatar for ritesh2190

You want a very high level programming domain-specific programming language. Treat the problem as such and you'll be less confused as how to proceed. However, creating a language (even a simple one) can be a surprisingly difficult undertaking if you're new to that particular field. I'd suggest making your "algorithm" …

Member Avatar for Anuradha Mandal
-1
4K
Member Avatar for Miyamoto

[B]>hey can someone explain O(logn) and not O(n)[/B] [URL="http://www.eternallyconfuzzled.com/arts/jsw_art_bigo.aspx"]Clicky.[/URL]

Member Avatar for arkoenig
0
980
Member Avatar for smart
Member Avatar for sylviaj
0
525
Member Avatar for jack223

>Based on the O notation, approximately how many swaps and >comparisons occur when Selection sort is called on a worst-case array of length 8? That's very poorly worded. Also, there's no such thing as a worst case for selection sort. The best, average, and worst cases are all identical.

Member Avatar for Adak
0
152
Member Avatar for Micko

There's no way to specify the orientation of a file opened by CreateFile, it's always binary. ReadFile and WriteFile work with raw bytes. >What I'm trying to do is to open file in binary mode and then to write >strings so that cannot be opened and examined with Notepad. Printable …

Member Avatar for progneer.soft
0
8K
Member Avatar for Geek-Master
Member Avatar for JackDurden

The error will also tell you what assertion failed and where it failed. Basically it means you used a library class or function the wrong way, such as passing a null pointer to strcpy.

Member Avatar for shijobaby
0
842
Member Avatar for akshayabc

>Plz answer my these C doubts- "Doubt" is sometimes synonymous with "question", but not in this case. It's very common to ignorantly use doubt in place of question, and it's usually wrong. What you have a C questions, not C doubts. >I dont want to know abt the scope of …

Member Avatar for gayathri balu
0
180
Member Avatar for rocky2008

calloc is essentially this: [code=c] void *calloc ( size_t n, size_t size ) { void *base = malloc ( n * size ); if ( base != NULL ) memset ( base, 0, n * size ); return base; } [/code] The difference is that the bytes are set to …

Member Avatar for surendra verma
0
177
Member Avatar for adarshcu

>im findin it hard to get topics to work on ? We get about ten threads every few days asking for suggestions. Why don't you use one of those?

Member Avatar for N1GHTS
0
169
Member Avatar for indianscorpion2

Hmm, none that I know of. You'll probably need to pick a discipline and derive the techniques of algorithm design and analysis from that discipline. May I suggest sorting? Sorting algorithms are full of useful ideas for other algorithm disciplines, they're [B]heavily[/B] researched, and you can find tons of information …

Member Avatar for ddanbe
0
211
Member Avatar for Ogakor

[B]>Am I correct?? I only want to verify.. Please answer.[/B] Pretty much, yes. [B]>So in link list, am I supposed to follow the same idea?[/B] The underlying concept doesn't change. However, note that while arrays give you fast random access, linked lists aren't nearly as forgiving. One benefit of merge …

Member Avatar for Martin B
0
199
Member Avatar for Shaabangbang

>i dont know how to reverse the string in memory How would you reverse "a"? Do nothing, clearly because the reverse of "a" is "a". What about "ab"? Mightn't you just swap the characters like this? [code] char save = str[0]; str[0] = str[1]; str[1] = temp; [/code] Keep adding …

Member Avatar for rajnish.singh
0
238
Member Avatar for emmybear
Member Avatar for Looben
0
95
Member Avatar for Milton Neal

[B]>Is seems C++ does not have a stream class that supports a read/write in the same open mode.[/B] You should do a little more reading on open modes with the fstream class. Read/write mode is both supported and common. The only caveat is the same as with C streams: when …

Member Avatar for Narue
0
245
Member Avatar for yapkm01

[B]>but why the variable number_value is 0. >I expect the value of 7.[/B] Deep under the hood (for g++), number_value is getting set to 0.0 because the "a" is read as a floating-point value and fails to be converted by strtod, which returns 0 if no conversion can be made. …

Member Avatar for Apple4
0
146
Member Avatar for Izork

[B]>which books is most efficient for a totally beginner to programming, C++?[/B] That really depends on you. Everyone learns differently; a great book for one might not be as good for another because of the way concepts are taught. Given a list of recommendations, the ideal is to have a …

Member Avatar for Izork
0
150
Member Avatar for Oakley & Ooijer

Define "help", because it looks a lot like you want someone else to solve it for you.

Member Avatar for Narue
0
99
Member Avatar for Lenny19

Both your min and max variables are uninitialized. Set them both to the first item in the array. As for the average problem, you're printing the average inside the loop rather than after it completes. The loop should only be summing the items: [code=cplusplus] for ( int i = 0; …

Member Avatar for saeed67
0
1K
Member Avatar for Alerwiali

[URL="http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_hashtable.aspx"]Clicky[/URL].

Member Avatar for Alerwiali
0
134
Member Avatar for iLoveNoodle

Yes and no. It depends upon whom you ask, but a common distinction is that the software engineer is more involved in the design aspects than the programmer, who simply churns out code according to an already specified design (ie. a code monkey).

Member Avatar for Guerino1
0
200
Member Avatar for Acidburn

>It just outputs a space on the konsole window and then hitting enter makes a new line... That's correct behavior. Input in C++ is line oriented. If you want to just hit a space and have it be recognized immediately, you need to use a non-standard function such as getch …

Member Avatar for Nirvin M
0
238
Member Avatar for shinichi78

7-bit ASCII is a strict subset of UTF-8, no conversion of values is necessary.

Member Avatar for Narue
0
32
Member Avatar for Akulki

[B]>It looks that u have not understood the question.[/B] I don't understand either. I'd wager that the problem isn't with us, it's with your ability to ask a coherent question.

Member Avatar for Akulki
0
81
Member Avatar for bigwhiteegg

Just one question, what were you expecting to happen with this? [quote] [code] for(int i=0; i<a.elements; i++) delete[] &a.element[i]; [/code] [/quote] All you need to do is the inverse of what you did to allocate the memory: [code] void deallocate(GrowableArray &a) { delete[] a.element; } [/code]

Member Avatar for Ancient Dragon
0
138
Member Avatar for LevyDee
Member Avatar for gurumo
Member Avatar for eltonpiko

It's pseudocode, there aren't any rules to follow, just make sure your logic is sound. Some people find flowcharts more intuitive, so you could start with that part of the assignment and derive the pseudocode from your result. To be perfectly frank, this smells like a Programming 101 assignment. I …

Member Avatar for Narue
0
442
Member Avatar for ranko_6

Most likely your strings aren't being terminated with '\0'. What does the file look like?

Member Avatar for ranko_6
0
208
Member Avatar for XMasterrrr

[B]>The C Programming Language...[/B] No, The C Programming Language (also known as K&R) is a fabulous book for learning C90 [i]if[/i] you already know how to program in another language. It's not very friendly to absolute beginners though. [b]C Programming - A Modern Approach[/b] by K. N. King is often …

Member Avatar for XMasterrrr
0
165
Member Avatar for DonutsnCode

You need to compile GradeBook.cpp as well. Only headers need not be compiled: [code] g++ main.cpp GradeBook.cpp -o main [/code]

Member Avatar for DonutsnCode
0
129
Member Avatar for samsons17

for(int i=0; i<count; i++) { data.push_back(input); } This is your input loop, but there's no input going on. You need to give the user time to input a value, then add the value to your vector: for (int i = 0; i < count; i++) { if (cin>> input) data.push_back(input); …

Member Avatar for Narue
0
123
Member Avatar for stereomatching

[B]>Obviously, the raw array is faster than the dynamic array of ublas and multi_array.[/B] Not by much, and the small difference can easily be attributed to the overhead of member function calls vs. direct indexing. So ask yourself one question: Is the difference a deal-breaker for using Boost? You really …

Member Avatar for Narue
0
141
Member Avatar for dragonpunch

[B]>It's standard, if not for beginners.[/B] Which is the single most annoying problem with how C is taught. Pointers are an integral part of the language, and really very simple conceptually. It's my opinion that they should be introduced as early as possible. [B]>Three ampersand (star) programmers are generally mocked …

Member Avatar for Narue
0
409
Member Avatar for duanz_88

Wow. While I'm sure this isn't a record, one lazy student asking for "help"[1] on an assignment followed immediately by another lazy student hijacking the thread asking for "help" on an unrelated assignment is a wonderful example of the present progression toward the fall of Daniweb. [1] "Help", of course, …

Member Avatar for sree_ec
0
2K
Member Avatar for banks2140
Re: HELP

You're overwhelming yourself. Start by reading the file and printing out each character, one-by-one. Break the problem down into smaller problems that are easier to tackle individually. Little successes are important, and having something simple that works is much better for keeping your spirits up while working on a problem …

Member Avatar for Fbody
0
106
Member Avatar for sanjuanair

[B]>What are the default values of the fundamental types?[/B] That's a fun little can of worms. :)

Member Avatar for Narue
0
125
Member Avatar for BLUEC0RE

I'll wait to see what the other people reading this thread have to say before giving you a good solution. :)

Member Avatar for gerard4143
0
3K
Member Avatar for mitrious

Two things: [list=1] [*]tolower doesn't take a reference parameter, it returns the converted character if such a conversion exists. The immediate problem in your code is that you aren't saving the converted character back into ret[[I]x[/I]]. [*]tolower will accept any value in the range of unsigned char or EOF. If …

Member Avatar for Narue
0
134
Member Avatar for pandaEater

[B]>BST::~BST();[/B] How is it non-recursive when you try to call the destructor recursively (not a good idea)? Personally, I'm a fan of unraveling the tree into a vine to simplify destruction. Then it just becomes a linked list destruction algorithm: [code] BST::~BST() { BinNodePtr save; for (BinNodePtr it = myRoot; …

Member Avatar for pandaEater
0
3K

The End.