15,300 Posted Topics

Member Avatar for kaku_lala

>>int memcmp_test(const char *cs, const char *ct, size_t n) I think the first two parameters should be [icode]const unsigned char[/icode] because memcmp() can work with binary blocks of data and typcasting unsigned char to char might produce undefined behavior.

Member Avatar for ArkM
0
351
Member Avatar for slim2hott

Oh what a joy Microsoft compilers are to work with. One click of the [ key and I found the problem. Mismatched { and } on line 214. There is another one, but I'm not telling where it is -- that's for you to find. :)

Member Avatar for NathanOliver
-2
677
Member Avatar for kkbronner

So what is the problem with that code, other than the obvious syntax error of missing closing }

Member Avatar for NathanOliver
0
152
Member Avatar for BlackStar

<<*A = *B; *B = *A; Looks like you are trying to swap the pointer addresses? Then you need a temporary holding pointer, and that function must return a pointer since that's how you declared it. [code] PointerA operator = (const& PointerA * C, const& PointerA *D) { PointerA* A …

Member Avatar for BlackStar
0
245
Member Avatar for anraevlus18

>>i'm gettin a compile time error : Lvalue required. which line? >>*ptr_1=ptr1; Probably cause an immediate crash. Why? Where does ptr_1 point to? It's undefined because it was never set to point anywhere. You can't just use a double star pointer like you are trying to do -- they don't …

Member Avatar for Ancient Dragon
0
100
Member Avatar for Joukon

[URL="http://msdn.microsoft.com/en-us/library/aa363196(VS.85).aspx"]Did you read these articles[/URL] ? And this [URL="http://msdn.microsoft.com/en-us/library/aa363424(VS.85).aspx"]example program [/URL]?

Member Avatar for Ancient Dragon
0
367
Member Avatar for power_computer

That for loop is incorrect. What you want is to read until either Max_Size has been read or until end-of-file [code] int i = 0; while(i < Max_Size && inFile>>array[i] ) ++i; [/code]

Member Avatar for power_computer
0
98
Member Avatar for ElWape

use references [code] class MyClass { public: typedef vector<int> Vector; MyClass(); ~MyClass() {;} [color=red] Vector& [/color] getVector() { return m_vector; }; private: Vector m_vector; }; MyClass::MyClass() { m_vector.push_back(1); m_vector.push_back(2); m_vector.push_back(3); m_vector.push_back(4); } int main() { MyClass t; // This works... [color=red] MyClass::Vector& [/color]myVector = t.getVector(); for(MyClass::Vector::iterator itr = myVector.begin(); itr …

Member Avatar for Ancient Dragon
0
143
Member Avatar for OffTheLeft

To increment [icode](*ptr)++;[/icode] Compile and run this little test program and you will see what it does. [code] #include <stdio.h> void foo(int* n) { (*n)++; } int main() { int n = 0; int i; for(i = 0; i < 5; i++) { foo(&n); printf("%d\n", n); } } [/code]

Member Avatar for OffTheLeft
0
105
Member Avatar for DaveD3

AFAIK the Express edition of that compiler doesn't support what you are attempting to do. I have never seen a menu option to add a data source. A couple years ago I used 2005 Pro version and it had that option. But I don't think the Express version has it.

Member Avatar for DaveD3
0
134
Member Avatar for BruenorBH

[URL="http://msdn.microsoft.com/en-us/library/ms646927.aspx"]This is what you are looking for[/URL]

Member Avatar for BruenorBH
0
168
Member Avatar for Prahaai

GetOpenFileName will put that information in your szFile buffer. And it should be declared and initializedlike this: [inlinecode] char szFile[_MAX_PATH] = {0}; [/inlinecode]

Member Avatar for Alexander22
0
2K
Member Avatar for paolomontero

what is that <> ? This compiled ok for me. all I did was removed the <> [icode]friend ostream & operator << (ostream &, const Nested &);[/icode]

Member Avatar for paolomontero
0
155
Member Avatar for metal_butterfly
Member Avatar for xyzt
0
105
Member Avatar for jagdeep89

>>It's urgent for me pls sir But it's not urgent for any of us. I could care less whether you pass or fail -- its your grade not mine. And we are not all men, so "sir" is inappropriate. Post what you have tried, or have you even tried to …

Member Avatar for ndeniche
-1
365
Member Avatar for Thinka
Member Avatar for Akis2000

>>pow(+1.0, n+1)/pow(n*n,2.0); How does (1/9) translate to the above equation? When [b]n[/b] = 1, the above will be [icode]pow(1,2) / pow(1,2)[/icode] which is 1^2/1^2 = 1. When [b]n[/b] = 2, we get [icode]pow(1,3)/pow(4,2)[/icode] which is 1/16 It looks to me your formula is completely wrong. How you get from (1/9) …

Member Avatar for Akis2000
0
115
Member Avatar for ongpong

[QUOTE=jephthah;857580]that's dumb. what if he wants to add 9999 as one of his numbers[/QUOTE] That's a common way to terminate user input, another is to type Ctrl+Z. If he needs to let the user enter 9999 then his program should choose a different number to terminate input.

Member Avatar for Ancient Dragon
0
119
Member Avatar for serkan sendur

[QUOTE=serkan sendur;852365] Do you also think that unix and programming on unix sucks?[/QUOTE] Absolutely yes. I hate *nix because its just too damn complicated to get anything done. There are, however, a few features I like, such as shell programming, awk and sed. MS-Windows batch files aren't in the same …

Member Avatar for serkan sendur
-1
418
Member Avatar for guest7
Member Avatar for guest7
0
163
Member Avatar for Adexter

Index would be similar [code] if(highTemp >= YrTemp[x][0]) { highTemp = YrTemp[x][0]; highIndex = x; // set index to be returned } [/code]

Member Avatar for Adexter
0
103
Member Avatar for bmcutler011
Member Avatar for Ancient Dragon

A nuclear attack is perhaps the most real and immediate end of the world scenario. No monsters need to be thought up, no fiction created to make this apocalypse possible. [URL="http://apocaluck.com/"]Go here [/URL]to find out how you would fair in a nuclear attack. For me: Shockware: Shaken Head Blast: Roasted …

Member Avatar for GrimJack
0
72
Member Avatar for mini programmer
Member Avatar for mini programmer
0
113
Member Avatar for serkan sendur

I used Raima databases 20 years ago when I was writing MS-DOS 6.X programs. At that time Raima was a hierarchical database (non-SQL) and quite easy to use. Several years ago Raima expanded its product to an SQL database, but I have not used it. AFAIK its language is pretty …

Member Avatar for bhouglum
0
144
Member Avatar for Sky Diploma

line 23: oops! that just lost the location of the memory that was allocated on line 13. You need to use a different pointer for incrementing and leave the original pointer unchanged.

Member Avatar for Ancient Dragon
0
191
Member Avatar for de-de
Member Avatar for Ancient Dragon
0
2K
Member Avatar for Crago3

you can use the macro toupper() to convert a character to upper case. If you have a whole string to convert then create a loop and convert each charcter [code] string str = "hello world"; for(int i = 0; i < str.length(); i++) str[i] = toupper(str[i]); [/code] In c++, an …

Member Avatar for tux4life
0
255
Member Avatar for lolaabbydawn128

You are almost done! :) All you have to do now is calculate the total points earned by the team and keep track of who earned to most points.

Member Avatar for siddhant3s
0
134
Member Avatar for kelechi96
Member Avatar for jephthah
0
456
Member Avatar for raimis100

[QUOTE=dailyearner;853857]what is it social bookmarking website?[/QUOTE] [URL="http://lmgtfy.com/?q=what+is+social+bookmarking+sites"]Read this[/URL] [URL="http://www.youtube.com/watch?v=x66lV7GOcNU"]Here [/URL]is one of the links that I though was really informative.

Member Avatar for WebDave
0
290
Member Avatar for billsmith7
Member Avatar for billsmith7
0
130
Member Avatar for u8sand

its done like this: [code] class Camera { public: [color=red] Camera(Array2D& a): worldRef(a) {} [/color] ~Camera() {} private: Array2D& worldRef; }; [/code]

Member Avatar for Ancient Dragon
0
363
Member Avatar for roryt

That was over 2 years ago. Instead of complaining in the thread you should have reported it. The Dude did not have any rep altering power so the bad rep he gave you only put a yellow dot on your profile.

Member Avatar for jephthah
0
534
Member Avatar for loudbeats.com

Are not all the forums in the Web Development and Internet Marketing menus enough?? What more do you want that doesn't already exist ?

Member Avatar for happygeek
0
273
Member Avatar for kisky84

you can not typecase char* to wchar_t* because wchar_t is a different data type, under MS-Windows its a short, but under *nix its a long integer. For string literals there is a macro in tchar.h [icode]address.streetAddress = _TEXT("Albareda 23");[/icode]

Member Avatar for Ancient Dragon
0
177
Member Avatar for tnimblett

Swap the entire structure, not just the time [code] struct players temp; int a, b; for (a=0; a < 32;a++) { for (b=0; b<32-a-1; b++) if (world[b].best_time < world[b+1].best_time) { temp = world[b]; world[b] = world[b+1]; world[b+1] = temp; } [/code]

Member Avatar for tnimblett
0
81
Member Avatar for Ancient Dragon

For some reason there is a line through the text "Game Development" menu -- see attached. I only find that when currently browsing the C++ forum. I'm using FF on Vista Home. Dani I suppose you could tuck this away for later when you aren't busy doing anything else :)

0
42
Member Avatar for vddmanikanta

>>Please do justify it with a small sample code Why? You already said you had written the class, so why should I bother?

Member Avatar for Ancient Dragon
0
47
Member Avatar for JainishP

The program needs some way to keep track of the values and the number of times the values appear in the array. Then its a simple matter to find the value that appears the largest number of times [code] struct item { int value; int count; }; [/code] now build …

Member Avatar for ArkM
0
4K
Member Avatar for siddhant3s

seems to have been fixed because I don't see that behavior. I see that you are only in the rough just once. So you must have gotten out of the rough a couple times :)

Member Avatar for Dani
0
58
Member Avatar for NicAx64

>>so I have no fear about using priate copies anymore\\ Oh I understand now. You can't stand killing an animal for food, but you don't have a problem from stealing the food out of someone else's mouth. Software piracy is theft.

Member Avatar for thoughtcoder
0
279
Member Avatar for lolaabbydawn128

Have you studied your text book? Have you paid attention in class (or even attended them) ? That assignment is not for beginners, but more likely mid-term or later. If you do not know what a pointer is then you will not be able to complete the assignment. Same with …

Member Avatar for Ancient Dragon
0
104
Member Avatar for legendarya49

Seemed to work for me, after fixing a few things. I just hard-coded the strings because I didn't want to type them every time I ran the program :) [code] XXXXXXXXXXX X X XLX XJXXXXXXX X XXX X X XXX X SXXXXX X XAXXX X XXX XXX XXX X X …

Member Avatar for Ancient Dragon
0
186
Member Avatar for DealthRune
Member Avatar for DealthRune
0
111
Member Avatar for kbmmartin

[QUOTE=kbmmartin;854873] 1. I'm not demanding. I'm asking a history question By the way, I've programmed for over 30 years at HP and TI. I'm a part-time prof at a local university and I couldn't answer this question asked by a student.[/QUOTE] If that is true that you have programmed for …

Member Avatar for siddhant3s
0
6K
Member Avatar for DJInsane

You need to fix all the errors before attempting to execute the program. Compile it with a C compiler instead of C++ -- most c++ compilers will compile files with *.c extension as C code, not C++. There were about 90 errors when I tried to compile it with VC++ …

Member Avatar for Ancient Dragon
0
115
Member Avatar for yara naser
Member Avatar for FlamingClaw

No one gets rep points good or bad here in Community Center Forum. Only get the colored dot on the post; does not affect overall rep points.

Member Avatar for Ancient Dragon
0
68
Member Avatar for nature_love

There is no such concept as "dereferencing and operator". Operators are like <, >, <=, /, +, etc. You probably mean dereferencing a pointer. [code] int n = 123; int* p = &n; *p = 0; // dereferencing a pointer [/code]

Member Avatar for ArkM
0
269

The End.