Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
10
Posts with Upvotes
9
Upvoting Members
10
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
2 Commented Posts
0 Endorsements
Ranked #977
~46.9K People Reached

46 Posted Topics

Member Avatar for vishnukumar

I'm still in college and I've made some simple games like tetris and pacman and currently working on a super mario 2D sidescroller variant, but not very large games, so I'm still a bit above a beginner when it comes to game development. I recommend you use C/C++ for game …

Member Avatar for NehaPande
0
383
Member Avatar for munchlaxxx

You don't need the iomanip header file. It just allows you to format your code nicely. So to make the above code work, just remove functions like `setw(number_here)` and it should compile.

Member Avatar for 0igo
0
17K
Member Avatar for deepecstasy

It's advisable not to use file.eof() because the stream only signals EOF when it reaches the very end of the file. So if there's an empty line or if there's extra whitespace at the very last element, the stream still considers data to be read. For example, inputData.txt ---------------------- 1 …

Member Avatar for deepecstasy
0
405
Member Avatar for jdh1231

The instructions to compile is at the very top: Compiler: mpicc -g -Wall -o name name.c mpirun -np 4 name mpicc is the compiler -g -Wall are additional options to pass to the compiler -o name is the output executable file called "name" name.c is the name of your source …

Member Avatar for dx9_programmer
0
161
Member Avatar for willygstyle

It seems the compiler is looking for the definition of the int main() function but it can't find it, but you want to make a DLL. The problem is you're compiling the code as an application (.exe) instead of a dynamic library (.dll). Go to project properties -> General -> …

Member Avatar for dx9_programmer
0
185
Member Avatar for NardCake

I suggest you reading about keyboard accelerators here on MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646337%28v=vs.85%29.aspx Keyboard accelerators is an easier way to handle combinations of keystrokss like Ctrl+Z or Ctrl+C You define the accelerators in your resource file, assign a hotkey and give it a unique name. // In your code, declare a handle …

Member Avatar for dx9_programmer
0
2K
Member Avatar for christinetom

Library files (.lib) are usually stored in a folder called lib. First you add the path to the search directory, so the compiler knows where the library files are. But you have to tell the compiler which library file (.lib) to link to. For example, a lib folder could have …

Member Avatar for christinetom
0
2K
Member Avatar for chris.causey.37

The variable ReadSect is given a proper value. Lines 12 and 13 become 0 << 9 and 0 >> 23 which both equal 0.

Member Avatar for dx9_programmer
0
310
Member Avatar for katsmiley

If you have multiple MAX macros, the compiler has to reserve memory for each occurence. ie. MAX + MAX - MAX is 3 substitutions of integer 5, so 4\*3=12 bytes reserved If you declare a constant, it's only declared and initialized once in memory, so it takes up only 4 …

Member Avatar for deceptikon
0
164
Member Avatar for Hopp3r

I think you mean "pass by reference" and not by value. Anyways, I recommend reading this about input/ouput with files here http://cplusplus.com/doc/tutorial/files/ You should also list an example of the file you're talking about.

Member Avatar for triumphost
0
3K
Member Avatar for testie
Member Avatar for alyssa.wilkins.77

Try printing to standard output instead. Perhaps the input data is not being read properly? You can also check if the input and output file is open with is_open() member function.

Member Avatar for dx9_programmer
0
332
Member Avatar for slygoth

You can read about input/output with files here http://cplusplus.com/doc/tutorial/files/ In order to store/read information from a file you have to create an object that represents the file. This is an example of storing data in a file. The great thing about file objects is that it's treated as a file …

Member Avatar for slygoth
0
163
Member Avatar for chris.vargas.773

The logic of your Bike class is completely wrong. When you pedal x amount of meters, you should add that to distance. Then when you want to get the distance travelled so far, you're simply return 0. Return 'distance' instead. You also have to use boolean variables to check if …

Member Avatar for dx9_programmer
0
136
Member Avatar for jake.jackson.7169709

Hmm, are you allowed to nest a function within a function? Like you have in your everyNth() function with the nested numDigits() function? Another thing is you cannot declare a static array with a variable. On line 23 you declared `int array[numLength]` which is not allowed. You must use a …

Member Avatar for dx9_programmer
0
231
Member Avatar for chris.vargas.773

Where's the `int main()` entry function? You have to include the constructor for your class under public. Where's the code for the functions in your Envelope class? You either didn't include the code or you didn't write them.

Member Avatar for dx9_programmer
0
174
Member Avatar for pattilupwned

You should use Visual Studio to debug through program and see where the problem is. The debugger will know if you're trying to access memory that doesn't belong to your program. Or you can always use printf() statements to see which ones output or not to debug the program. Segmentation …

Member Avatar for dx9_programmer
0
365
Member Avatar for Monster99d

You should clear out the `WNDCLASS wc` structure to empty with this: `ZeroMemory(&wcex, sizeof(WNDCLASSEX));` Try using `ShowWindow(hWnd, SW_SHOW)` with SW_SHOW as a second argument.

Member Avatar for nullptr
0
107
Member Avatar for Elixir42

You are able to change the sampling state any time you wish. Because you're modifying the filters for textures that are minified (opposite of magnified), you should see the difference of the texture from a distance. You can try using the same texture of the same size drawn far away …

Member Avatar for Elixir42
0
229
Member Avatar for Kamina00

You're right, that is the proper behaviour. If an error occurs on input operations, subsequent input operations will fail to work. So I'm guessing an error occurs when you just enter "hello" with no space. Check for error/EOF flags with fail() or eof() methods. For example, char name[200]; cin.get(name, 200); …

Member Avatar for Kamina00
0
1K
Member Avatar for Sasquadge

If you wanted to add two fractions together, you need two objects of class fraction. You should use a third object to store the result. You already have the formula, so implementing is quite easy. Just remember, your fraction class represents only "one" fraction, so use more than one and …

Member Avatar for Despairy
0
235
Member Avatar for Elixir42

It's not supposed to work like that. You have to create the font again, replacing the old one. So call CText::Create() with an italic parameter.

Member Avatar for Elixir42
0
369
Member Avatar for Delnith

Your scanf should be `scanf("%d,%d", &coef, &degree)` There is a logical error with your while loop condition. You say you want non-zero coefficients and any degree, but exit if both are zero? Correction: `while (coef == 0 || !(coef == 0 && degree == 0));` If coef == 0 just …

Member Avatar for Delnith
0
89
Member Avatar for Secone

Lines 309-315 (WordList.cpp) you have the following code but the variable 'indx' was never declared? And you have to make sure indx is not out of bounds which could cause the program to crash. If for example, indx exceeds CAPACITY. const void WordList::operator+=(string word) { if (indx < CAPACITY) { …

Member Avatar for Secone
0
169
Member Avatar for sandy.phan.37

You should struct/class declarations in your header file (.h) list.h struct list { node_t* head; }; typedef struct list list_t; Because when you rename the structure list to list_t but nowhere was struct list defined before that line.

Member Avatar for deceptikon
0
8K
Member Avatar for Elixir42

Header files can be quite confusing and with the inclusion of so many header files, it can be difficult to track the bug. A possible culprit is with main.h and CApplication.h **main.h** #include "CApplication.h [...] **CApplicationn.h** #include "main.h" [...] **CApplication.h** <--- expanded [substitute in main.h] [...] #pragma comment (lib, "d3d9.lib") …

Member Avatar for Elixir42
0
1K
Member Avatar for munchlaxxx

You should just put all the code that you're going to repeat under the while loop, instead of splitting it up. In fact, use a do loop which guarantees it always runs once. do { cout << "Average calculator." << endl; cout << endl; cout << " Enter a stream …

Member Avatar for np complete
1
196
Member Avatar for straylight

> i dono y ur complicating too much just try this The question wants you to reverse the entire string then each word within the string. Example, Our string: "The sky is blue" Reverse the entire string: "eulb si yks ehT" Reverse each word in the string: "blue is sky …

Member Avatar for rithish
0
1K
Member Avatar for muhammad.khan.3576

Think about what WaltP said. If the result is always zero, then none of the if statements are true. You never get a value greater than or equal to 70,000 or 50,000 or 30,000.

Member Avatar for muhammad.khan.3576
0
194
Member Avatar for kruschev

You can compare strings with function strcmp(). For example int i; char* names[3] = { "john", "jessica", "james" }; char* findname = "jessica"; for (i=0; i<3; i++ ) { if (strcmp(names[i], findname) == 0) { printf("We found a match to %s at index %d", findname, i); } }

Member Avatar for WaltP
0
147
Member Avatar for rebelstar

This is not what you want: `sizeof(A/2)` You want `sizeof(A)/2` You can't divide the A by 2, that doesn't make sense, right? Move the 2 outside the brackets.

Member Avatar for dx9_programmer
0
174
Member Avatar for mike.severini.3

I advise you to format your code so it's easier to read, because it's hard to help someone when the code is hard to read. The task is simple if you think about it in steps. 1. Open the file. 2. Read the number of patients first, the first line …

Member Avatar for dx9_programmer
0
270
Member Avatar for Secone

Lines 298-303 (wordlist.cpp), in method `const void WordList::operator+=(string word)` just check if the indx is within range. // do we have space to add 1 more word? if (indx + 1 < CAPACITY) { setWord(indx, word); incWordCount(indx); incNumWords(); indx++; } Line 149 (p2.cpp) you have `void readFile(ifstream &filein, WordList WL)` …

Member Avatar for dx9_programmer
0
274
Member Avatar for Koji01

char sn[5] should be char sn[9] (4 more characters to fit '.txt' suffix) but yes fopen works, remember strings must be wrapped in double quotes "" like fopen("03/1234.txt", "r")

Member Avatar for Koji01
0
632
Member Avatar for RonKevin

It would be much easier if you posted the line on which the syntax error occured, if it is possible anyway. However, the problem I see is with line 99: in >>data[i].barcode >> data[i].prodname >> data[i].category >> data[i].price; The member variables 'prodname' and 'category' of type std::string but you're trying …

Member Avatar for RonKevin
0
155
Member Avatar for albert.antwi.90

Can you explain more about the problem? Like give an example. Sounds like your problem is math-related? System of equations like? I only have guesswork so you have to explain more.

Member Avatar for WaltP
0
188
Member Avatar for Ubunterooster

Clear error on line 81. You never passed anything to printResult(). It should be like printResult(integer_here, double_here, double_here, double_here).

Member Avatar for Ubunterooster
0
315
Member Avatar for mike.severini.3

Proper indentation of lines makes it much easier to read, hard to tell if a piece of code executes inside the for loop or outside. But I can see what you're trying to do. Should look like this, with proper indentation using spaces and tabs: for (i = 1; i …

Member Avatar for mike.severini.3
0
144
Member Avatar for zvjezdan.veselinovic

If you're calling `student_Data.getAwardAmount();` you should store the return value in a variable as such and pass the variable to : `getScholarship_Money()` int number_of_awards = student_Data.getAwardAmount(); student_Data.getScholarship_Money(number_of_rewards); But first change this `getScholarship_Money(int getAwardAmount())` to `getScholarship_Money(int awards)` To your other question, you cannot return two or more values, you are only …

Member Avatar for zvjezdan.veselinovic
0
222
Member Avatar for HelloJarvis

Each string in 'arrayList' has to have enough space to store LETTERS+2 characters plus 1 for the null character if you're using strncpy(). So you have to declare 'arrayList' as `char arrayList[100][LETTERS+2+1];` or something similiar. Or perhaps your 'arrayList' doesn't have enough space, so you could be going past the …

Member Avatar for dx9_programmer
0
247
Member Avatar for HelloJarvis

There are several problems with your code. A segmentation error most likely means you access a variable outside the range of an array of some sort, such as your scores or alphabet array. 1. The variable score (singular) is not declared. 2. The while loop should be an if statement …

Member Avatar for HelloJarvis
0
1K
Member Avatar for sanghai45

Can you run it through a debugger? You should try stepping through the code using a debugger. Otherwise, try using several printf() statements and see where it fails to print. There are a few things to note, when you write `mCard = new Card*[52];` (line 26) means you're declaring an …

Member Avatar for dx9_programmer
0
164
Member Avatar for Dman01

I think you have to specify the type T. Template functions, I believe, can only deduce what T is based on the arguments passed. The compiler does not know if you want to return an integer or float based on having std::string as an argument, for example. `int x = …

Member Avatar for Dman01
0
199
Member Avatar for cih1091

I could see that you've tried sorting the grades in the for loop which appears to be like a bubble sort (google that) with all the swapping. Like Ancient Dragon said, there are many ways you can sort data, just search sorting algorithms and use whichever one you think you …

Member Avatar for WaltP
0
116
Member Avatar for ilvanhellovan

I assume you're working with the Windows API which include types like LPSTR or UINT or LPTSTR. These are just normal types you're familiar with but given a different name to be used specifically on a windows machine. ie. UINT = unsigned int LPSTR = char\* LP stands for "Long …

Member Avatar for deceptikon
0
2K
Member Avatar for Khoanyneosr

I believe it has to do with whether your project is a console versus a win32 app. You can check this in the project->properties under linker->system. The "system" must be Windows and NOT console.

Member Avatar for Khoanyneosr
0
271

The End.