6,741 Posted Topics

Member Avatar for Khoanyneosr

[B]>while (done = false)[/B] That = is not the same as == issue has been coming up a lot recently. Your loop condition is always going to fail because now done is false and that's the result of the expression.

Member Avatar for Narue
0
233
Member Avatar for arun_taurean

At first I was going to post up my own AES code when I had the time, but after the constant bumping with zero-value posts and duplicate threads, I think I'll just let you figure it out on your own. Nice job.

Member Avatar for arun_taurean
0
466
Member Avatar for subith86

You're printing the address of the pointer, not the value of the pointer. cout will interpret [iCODE]cout<< a[/iCODE] as a C-style string though, so you need to cast it to void* to get the correct value: [code] cout<< (void*)a <<endl; [/code]

Member Avatar for subith86
0
148
Member Avatar for nory22

Try it and see. Include leading whitespace in your input string. p.s. Come up with better thread titles. I very nearly reported this thread as a duplicate, and I'll refuse to help for future questions titled "need help with Dev C++".

Member Avatar for Narue
0
137
Member Avatar for Szeth

If you want to use exceptions, the code must generally be written with them in mind from the start. Tossing exceptions in as an afterthought has never ended well, in my experience.

Member Avatar for Szeth
0
221
Member Avatar for taumang

You need to clarify the algorithm first. Are count and x the same entity? Because if not, you need to specify what the starting value for x is and update count in the loop or it will run infinitely. Is the else clause tied to your while loop such that …

Member Avatar for taumang
0
108
Member Avatar for arun_taurean
Member Avatar for jayzee1989

imgSet is a 2D array, dude. [iCODE]printf("%c ",imgSet[i])[/iCODE] isn't doing what you think it's doing.

Member Avatar for jayzee1989
0
146
Member Avatar for mktr

AES is popular on this forum right now... As for your issue, you realize that the difference between hexadecimal and decimal is superficial, right? The underlying value is the same, so your problem is imaginary. Can you elaborate on exactly what isn't working as expected when you "input" your own …

Member Avatar for Narue
0
7K
Member Avatar for s.subbarao

[QUOTE]to avoid it i want to develop on software with few updates[/QUOTE] The updates you speak of are definitions of newly discovered viruses and occasionally software improvements. When writing reactive software, there's really no avoiding regular updates for something as constantly evolving as viruses. If you're thinking of a strictly …

Member Avatar for orwell84
0
113
Member Avatar for almostbob
Member Avatar for AntonAL

[B]>The serial number of motherboard must be obtained. >How to do it under Windows ?[/B] [URL="http://technet.microsoft.com/en-us/library/ee692772.aspx"]WMI FAQ[/URL].

Member Avatar for somjit{}
0
2K
Member Avatar for Portgas D. Ace
Member Avatar for doctorkasim

Help comes to those who first help themselves. In other words, what have you done so far?

Member Avatar for doctorkasim
0
95
Member Avatar for iamcreasy

[QUOTE]I believe that is wrong.[/QUOTE] Actually, it's correct. A POD type (either using the class or struct keyword) is one of the situations where the compiler doesn't need to synthesize a constructor, and compilers will generally not do so for performance reasons. Though it's a bit of a leap to …

Member Avatar for Narue
0
137
Member Avatar for shantanusinghal
Member Avatar for Narue
0
641
Member Avatar for lochnessmonster

"%7s" instead of "%s". The field width will limit how many characters scanf reads and places into the array. Or better yet, use fgets for string input.

Member Avatar for navedalam
0
75
Member Avatar for sharksaw40

Do you have a handle on C++ fundamentals as well as the primary algorithms and data structures? If not, you'd best focus on those things for a bit. Once you get into real world development, strong fundamentals will be your biggest asset. And if you jump in too soon, you'll …

Member Avatar for sharksaw40
0
279
Member Avatar for SolidSora

[B]>middleName.length[/B] Length is a member function, not a data member. I'd also recommend using size() instead of length(), since length() is specific to the string class while size() is used in the standard container libraries.

Member Avatar for template<>
0
116
Member Avatar for boschow

It looks like you want an object: [code] struct functions { int AND_function ( int lhs, int rhs ) { // ... } }; int main() { functions fun; fun.AND_function( 5, 10 ); } [/code] What exactly are you trying to do?

Member Avatar for asa22
0
157
Member Avatar for Dani
Member Avatar for daviddoria
Member Avatar for VernonDozier

[QUOTE=VernonDozier;1484287]>> since your first operand of || was true, it skipped the foo() call in the first example. That part I understand and expected. However, I expected the second part to also output 0. From the link, I see that both "left to right evaluation" and "short-circuiting" are mandated (thanks …

Member Avatar for Ancient Dragon
0
176
Member Avatar for caut_baia

[QUOTE]I'll just get to the point.[/QUOTE] That's certainly better than the alternative. [QUOTE]I want to write objects of type B to a file in binary form using fstream and it's 'write' member function.[/QUOTE] That would be unwise. B is not a POD type, which wreaks all kinds of havok when …

Member Avatar for Labdabeta
0
653
Member Avatar for gaurav_13191

[QUOTE]But my doubt is that if a linked list has a loop, then wouldn't it be a circular linked list?[/QUOTE] Not necessarily. This is a circular linked list: [CODE=text] a -> b -> c -> d -+ ^ | | | +-----------------+ [/CODE] This is a list with a loop, …

Member Avatar for gaurav_13191
0
91
Member Avatar for cableguy31
Member Avatar for cableguy31
0
152
Member Avatar for Utsav Chokshi

[QUOTE]Standard is flawless.[/QUOTE] Even when it's wrong. The C standard has had contradictory clauses in the past. Imagine the confusion that ensued. ;)

Member Avatar for nezachem
0
244
Member Avatar for kutuup

[B]>if(insertedPlayer < current)[/B] You're comparing pointers, not the "id" data member.

Member Avatar for kutuup
0
122
Member Avatar for maikens

You have a dictionary of words somewhere, right? My first attack would be to put the dictionary into a trie, with a special search that returns the end of the first complete match from the end of the most recent match. For example given a very limited dictionary: [code] #include …

Member Avatar for pseudorandom21
0
236
Member Avatar for kutuup

You wrote past the end (or beginning) of your dynamic memory and corrupted any bookkeeping data required by the heap manager.

Member Avatar for kutuup
0
219
Member Avatar for lochnessmonster
Member Avatar for zxzniczxz

[QUOTE]this is not my homework..i only want to get advance for my study in c++.[/QUOTE] I fail to see how it not being homework somehow exempts you from making an honest attempt.

Member Avatar for hag++
0
149
Member Avatar for vineeshvs

Before looking for ways to do this, maybe you should consider why you want to do it in the first place. Bitwise operations not working on floating-point isn't much of an issue because most of the time it's nonsensical.

Member Avatar for vineeshvs
0
310
Member Avatar for lochnessmonster

The third argument is valid (it's just a c-style string), but the fourth argument is incorrect. name.size() or name.size()+1 is likely what you intended.

Member Avatar for Narue
0
102
Member Avatar for Tursup

cout is smart about types. If you try to print a char, it will be interpreted as a character rather than a small integer. If you copy that value into an int object and print [i]that[/i] cout will no longer interpret it as a character. You're seeing the integer value …

Member Avatar for Tursup
0
139
Member Avatar for triumphost

Instead of worker.abort(), use this: [code] keybd_event(VK_RETURN, 0x3d, 0, 0); keybd_event(VK_RETURN, 0x3d, KEYEVENTF_KEYUP, 0); worker.join(); [/code] The problem was that stdin was locked by getch, and terminating the thread didn't release the lock. The simplest solution I can think of is signaling a keyboard event to unlock stdin and stop …

Member Avatar for Narue
0
337
Member Avatar for chound

>Is it possible to create programmes to run on coumputers thad do not have any operating systems? No, since to do so would require you to write an operating system to some extent.

Member Avatar for aer9998
2
222
Member Avatar for Phil++

I don't understand the question. What do you mean by "plain text substitution"?

Member Avatar for Adak
0
179
Member Avatar for mrdunndoneit

It sounds like your hard drive has died. The computer can't find a boot sector and is asking for one.

Member Avatar for tje210
0
29
Member Avatar for axn
Member Avatar for triumphost

Try creating a new thread for accepting input and manage the timeout in your main: [code] #include <windows.h> namespace jsw { namespace threading { class auto_event { public: auto_event(): _event(CreateEvent(0, false, false, 0)) {} BOOL wait(DWORD timeout = 1) const { return WaitForSingleObject(_event, timeout) == WAIT_OBJECT_0; } BOOL set() { …

Member Avatar for Dingbats
0
2K
Member Avatar for triumphost

What's the ultimate goal here? Are you just trying to report the uptime of a process, or is this more of a control to keep the process from running continuously for a certain amount of time?

Member Avatar for triumphost
0
176
Member Avatar for Dec28

fgets includes the trailing newline, so when the user types "pwd", the resulting string is actually "pwd\n". Try removing the newline after your fgets: [code] if (fgets(text, sizeof text, stdin) != NULL) text[strcspn(text, "\n")] = '\0'; [/code]

Member Avatar for Narue
0
212
Member Avatar for purepecha

[QUOTE=Lerner]I'd separate the original array into two separate arrays, one for evens and one for odds. Then I'd loop through the arrays printing evens and odds with the same array index on the same line. If there was more even than odd or visa versa, then I'd print an empty …

Member Avatar for arkoenig
-1
1K
Member Avatar for Utsav Chokshi

I want to know when you'll use this knowledge anywhere except in a class taught by an idiot. Yes, there are other answers, but they follow the same concept. And your code is only correct with the condition that the compiler supports a void return from main. Otherwise it invokes …

Member Avatar for rajeevpareek
0
93
Member Avatar for Dexxta27

[QUOTE]It was here that I was told that I was shown that, and it doesn't give any errors at all.[/QUOTE] Most likely your compiler is being helpful and ignoring the typedef keyword. Turn up your warning level and you'll probably see some mention of it. This is the correct syntax: …

Member Avatar for Dexxta27
0
154
Member Avatar for zack654

That's not a tutorial, it's a reference. References only tell you what's available, not how to use it (except perhaps with a small example). I'm not aware of any good full tutorials on string handling in C++, but I don't doubt that there are many to be found from a …

Member Avatar for zack654
0
137
Member Avatar for patrioticparado

Thanks for those kind words. :) To answer your question, I prefer Visual Studio with the Comeau front end and Dinkumware standard library implementation. Though that doesn't stop me from using several compilers on a regular basis. It's a habit I got into for maximum portability.

Member Avatar for Narue
0
119
Member Avatar for vavazoom

Which array class? Standard C++ does not define such a class, though the TR1 extensions (which are blessed in C++0x) do provide a fixed array class. Without knowing the library you're using, it's hard to make a suggestion. Though honestly, an array class is easy to write. And the only …

Member Avatar for Narue
0
221
Member Avatar for zacblazic

How do you know str ends with '\0'? Unless you placed on there explicitly, the error is correct and you're walking off the end of the string.

Member Avatar for Narue
0
140

The End.