279 Posted Topics

Member Avatar for me_ansh
Member Avatar for freddan007

You haven't posted the manifest file. Did you [icode]InitCommonControlsEx()[/icode]?

Member Avatar for freddan007
0
763
Member Avatar for risa

Here's the list of [url=http://msdn.microsoft.com/en-us/library/ms645540(VS.85).aspx]virtual key codes[/url]. jencas makes a good point that I was wondering about myself. Still, give it a try and let us know what happens.

Member Avatar for mitrmkar
0
249
Member Avatar for yuvaraj.tr

You're going to have to give more info, and preferably less code. What (non-standard) libaries are you using? For example, is FGS_GetCurrentKeyCode() a library function? Also, what does this mean exactly: "once game is over then it is taking the values from keys".

Member Avatar for nucleon
0
102
Member Avatar for daviddoria

Check out post number 11 (by StuXYZ) in this [url=http://www.daniweb.com/forums/thread179430.html]thread[/url] (from earlier today).

Member Avatar for nucleon
0
3K
Member Avatar for monkey_king

If "inlining the spezialized member functions" works, what's wrong with that solution? The only other thing I can think of (if I understand the problem) would be to put those functions in an object file of their own.

Member Avatar for StuXYZ
0
847
Member Avatar for Bladtman242

[QUOTE=Bladtman242;803425]Why does that not work? :/[/QUOTE] It works for me. Did you put test.bat in C's root dir? Here's a rewrite that starts it from the desktop. [code] #include <windows.h> int main() { char path[MAX_PATH]; GetEnvironmentVariable ("HOMEPATH", path, MAX_PATH); strcat (path, "\\Desktop"); ShellExecute (0, "open", "test.bat", 0, path, SW_NORMAL); return …

Member Avatar for Bladtman242
0
1K
Member Avatar for Mossiah

Alternatively to cin.ignore(...) and such tactics for consuming a leftover newline, you could use getline to read choice, thus not leaving any newlines in the input buffer.

Member Avatar for vmanes
0
111
Member Avatar for leebria

In essence your char array already has "hex" values in it, or decimal numbers or characters or however you wish to imagine them. Transferring them to another (unsigned char) array will not really change anything. You should post what code you have to clarify your question. (BTW, 0x03 is not …

Member Avatar for leebria
0
1K
Member Avatar for Crul

I'm not sure if this is what the errors indicate, but have you properly wrapped your C declarations like so: [code] #ifdef __cplusplus extern "C" { #endif int cfunc1( int n ); int cfunc2( int n ); #ifdef __cplusplus } #endif [/code]

Member Avatar for Salem
0
1K
Member Avatar for fmylife

Prototypes go at the top of the program (usually). You have an extraneous semicolon at the end of this line which causes it to not control the next line as you expect it to: [icode]if(CompareStrings(text[i], text[i+1]) == -1)[color=red];[/color][/icode] Also, the indices you are using in the above line are entirely …

Member Avatar for csurfer
0
103
Member Avatar for MrPickle

You have to fill in the template to instantiate it: [icode]std::vector< foo< int, double > > bar;[/icode]

Member Avatar for StuXYZ
0
99
Member Avatar for freddan007

Try [url=http://msdn.microsoft.com/en-us/library/ms683190(VS.85).aspx]GetExitCodeThread[/url].

Member Avatar for freddan007
0
526
Member Avatar for saphira

The problem is that the OP has not yet written any code. This looks like code handed out with the assignment. BTW, shouldn't the tab size for displaying code on this site be 4, not 8?

Member Avatar for Salem
0
4K
Member Avatar for aarti_gehani

Open the file in binary mode: [icode]fp = fopen( filename, "rb" );[/icode] Read known structures and arrays with fread. Read bytes with fgetc.

Member Avatar for nucleon
0
74
Member Avatar for sisse56

If you have done your program like above, but not run & edit program, then run & edit program, then ask specific question. And use code tags.

Member Avatar for Freaky_Chris
-1
105
Member Avatar for atreides27

You have a mismatch of the two declarations of add. Change: [icode] friend AltMoney add(AltMoney m1, AltMoney m2, AltMoney& sum);[/icode] to [icode] friend AltMoney add(AltMoney m1, AltMoney m2);[/icode] And change: [icode]add(m1,m2, sum);[/icode] to [icode]sum = add(m1,m2);[/icode]

Member Avatar for siddhant3s
0
450
Member Avatar for peacerosetx

Your code is spaced all over the place. Mixed spaces and tabs? If your basic question is how to initialize reference members of a class, you do it like this: [code] class Class { /*...*/ }; class Class2 { Class& m_class_ref; //... public: Class2(Class& class_ref); //... }; Class2::Class2(Class& class_ref) : …

Member Avatar for peacerosetx
0
108
Member Avatar for Acis

The problem with your menu is that you're reading into a char but testing against an integer. Change gmOption to an int. I'd finish the rest of the program first before worrying about how you will integrate cheats into it. BTW, I'd make some consts for the colors, make the …

Member Avatar for siddhant3s
1
160
Member Avatar for integralJill

So the prime number file is correct at school as well as on ubuntu? Only outputing to standard output (reading from the perfectly correct file) is not working??? I would've imagined that the numbers from the different children would get mixed up in the file if you don't use file-locking. …

Member Avatar for integralJill
0
706
Member Avatar for guest7

I don't see why it's a segfault, but you are using compare incorrectly. Remember that it returns 0 if the strings are equal, so you want to keep looping while it is not 0. You are doing the opposite, looping as long as the string IS "cls". You could just …

Member Avatar for Ancient Dragon
0
113
Member Avatar for deerowbear

Remember to always look for punctuation errors near the error line. Here you forgot the semicolon after [b]enum cmp_t[/b] (after the closing brace).

Member Avatar for siddhant3s
0
128
Member Avatar for Innercoder76

Two obvious problems in countNeighbors: [list=1] [*] You are not bounds-checking (row or col plus or minus one may be out-of-bounds). [*] You are testing against true when you've loaded your "array" with '0' and '1' (i.e., change true to '1') [/list] Other than that you need to post all …

Member Avatar for nucleon
0
94
Member Avatar for JustLearning
Member Avatar for jaanu.cheruvu

Think about it for awhile, then check out [url=http://en.wikipedia.org/wiki/Binary_search]wikipedia[/url].

Member Avatar for death_oclock
0
101
Member Avatar for mimis

Binary trees have 2 branches (max) at each node. To store an arbitrary number of links you need an expandable data structure, like a vector.

Member Avatar for GDICommander
0
113
Member Avatar for jaanu.cheruvu

> it takes so much of time to find a number greater > than searching number That's the heart of the problem. How do you decrease that time? You definitely don't want to do a linear search! I guess I understand the "infinity" stuff. It means that you can access …

Member Avatar for jaanu.cheruvu
0
357
Member Avatar for phillipdaw

First of all, this is an excellent effort and an interesting program. Here are some suggestions. [list] [*]Give the user the option to go again. [*]Use C++ style includes: cstdio, cstdlib, etc. [*]Never let a line go over, say, 78 columns. (Definintely not over 80.) [*]Splitting string constants across lines …

Member Avatar for siddhant3s
0
105
Member Avatar for BruenorBH

Try making [b]hWndCurrentTime[/b] global. Then change [b]strCurrentTime[/b] (in ThreadTime) temporarily to "xyz" and see if it displays. If not, then you'll need to do what AD suggests.

Member Avatar for BruenorBH
0
149
Member Avatar for emj83

Depends on the format of the matrix in the file. Is it text or binary. If it's text, can you cut and paste it?

Member Avatar for nucleon
0
35
Member Avatar for guest7

I think it's just the X in your input file (should be a 1 maybe?). Your expected output is unexpectedly short, having only nine members.

Member Avatar for daviddoria
1
129
Member Avatar for otterfreak

[icode]err = execve ("./server.c", param, 0);[/icode] You are trying to run the C file! You have to run the executable.

Member Avatar for Salem
0
1K
Member Avatar for bigOnotation

You do not want to free temp there. Remember that you do not free pointer variables, but the memory that they point to. In this case, you do not want to free the memory that temp points to because you still have a pointer (*head) pointing to it and the …

Member Avatar for nucleon
0
98
Member Avatar for aries_rupali

IVR: "Interactive Voice Response" But what is a "car dial"? How much C do you know?

Member Avatar for Luckychap
0
69
Member Avatar for Argo54325

You need to clear the flags before the seek. [code] file.clear(); file.seekg (0, ios::beg); [/code]

Member Avatar for nucleon
0
186
Member Avatar for fusi0n423

There does not seem to be anything wrong with your code. In particular, I see nothing that can cause an exception in what you've posted.

Member Avatar for nucleon
0
306
Member Avatar for chriscross86

Splitting hairs somewhat further, a better formatting for the printf with the long string is: [code=C++] printf("\nYou have entered an invalid integer.\n" "Please enter a number smaller or equal to 20:\n"); [/code] String literals separated only by whitespace are concatenated by the compiler. A useful fact.

Member Avatar for Dewey1040
0
102
Member Avatar for Emerald214

Inside the class, "a" is really just a pointer variable, which is usually the same size as an int, so that's why you get one. Outside the class, "a" is a 3-element int array, so that's why you get 3. Remember that C++ does not automatically know the size of …

Member Avatar for Emerald214
0
147
Member Avatar for weasel7711

[code] char buffer[100]; ifstream f; f.open ("pic.bmp", ios::binary); // skip header f.read (buffer, 54); // read 8 bytes into buffer f.read (buffer, 8); [/code]

Member Avatar for nucleon
0
312
Member Avatar for scias23

Thr program still has a bug, though. You are not zero-terminating the c-string "rev". The best way is perhaps: [code] int i, j; for(i = 0, j = strlen(word) - 1; j >= 0; i++, j--) rev[i] = word[j]; rev[i] = 0; // zero-terminate rev [/code] Note that I changed …

Member Avatar for jencas
0
285
Member Avatar for 6ky8ngel

Since key_c_xor is an array, it needs an index: [icode]key_c_xor[color=red][j][/color] = userKeyArray[t]^C[i];[/icode]

Member Avatar for nucleon
0
42
Member Avatar for daviddoria

You would just do this: [code] void CharArray(unsigned char* arr) { ... } int main() { unsigned char arr[3]; CharArray(arr); } [/code] [quote]Which is the most modern (ie c++) way to do this?[/quote] C++ is over 20 years old.

Member Avatar for ArkM
0
86
Member Avatar for monocog

This is looking more and more like homework. Where did you get the main from?

Member Avatar for nucleon
0
167
Member Avatar for shasha821110

It's saying that you can't delete the original "b" anymore because you've lost it's address by assigning a to b, which overwrites the previous address that b was holding. So the last line frees the original a, since b now points to a.

Member Avatar for verruckt24
0
146
Member Avatar for bemo55

I see you TRIED to use code tags. Good effort. I'm not sure why they didn't work. Here's your code with the undeclared identifier errors fixed. It probably doesn't work correctly (I didn't bother to check that) but at least it will run for you. [code] #include <stdio.h> int askflight(int[]); …

Member Avatar for zalezog
0
133
Member Avatar for ryan858

Presumably it's something under the Project Options: Compiler tab. Perhaps try setting Linker: Strip Executable to yes.

Member Avatar for nucleon
0
105
Member Avatar for trevorp

You are missing a quote (in red): [icode]cout<<"VectorA ^ VectorB = " (VectorA^VectorB)[color=red]"[/color]<<" = "<<(VectorA^VectorB).Magnitude()<<endl;[/icode]

Member Avatar for nucleon
0
193
Member Avatar for shindu
Member Avatar for tendolm

LTIME must be either 12 (for hours) or 720 (for minutes), it cannot be 12:00 since that is not a proper C constant. Since you are implying that Tcorr is minutes, make LTIME 720. Then if you need the time in hours and minutes: [code] hours = stime % 60; …

Member Avatar for nucleon
0
146
Member Avatar for Alex_

Also note that you have to use radians (not degrees) for your angles, so [icode]pass = 2 * M_PI / vertex[/icode] (M_PI is in math.h) .

Member Avatar for Alibeg
0
178

The End.