624 Posted Topics

Member Avatar for Mako-Infused
Member Avatar for Mako-Infused
0
221
Member Avatar for clutchkiller

Use a 2d array to represent the tic tac toe grid, not a seperate variable for each place >.< . And also...post the whole code. I don't understand why your calling wincond() at the start of main. It does literally nothing there. Also, never forget to initialize variables! Also, you …

Member Avatar for clutchkiller
0
136
Member Avatar for extrov

(x - a) ^ 2 + (y - b) ^ 2 = r ^ 2 Where a and b are the center coordinates, and r is the radius. This should help you solve for x, and y, given one or the other. This is useful for plotting, but sin, cos, …

Member Avatar for extrov
0
172
Member Avatar for bugmenot

[QUOTE=bugmenot;730013]If I initialize graphics in my program and then use cout the font appears bigger than normal and the cursor doesn't blink on the screen as it does when the graphics are not initialized.Is there any way I can use graphics as well as cout in my program?If yes how …

Member Avatar for asifjavaid
0
777
Member Avatar for amerninja2

Do a google search on PCM wave format header information, then create a struct/class with all the neccessary members that the header contains, plus a dynamic array (vector perhaps) of actual raw wav data. You will then need to find an appropriate library/dll for interpreting the data and sending it …

Member Avatar for skatamatic
0
73
Member Avatar for skatamatic

I'm writing a class for simple equation parser. I've completed the - and + operators, and am currently working on implementing brackets. They seem to work most of the time, except I occassionally get strange results, such as with 10 - ((10 - 20) + (10 - 20)) returns 40! …

Member Avatar for iamthwee
0
135
Member Avatar for swbuko

Sounds like your trying to parse a function. You'll have to enter the function as a string (either char * or string class), then use a loop to figuire out its contents. Depending on how robust/useful you want it to be, this could be a bit challenging for a beginner. …

Member Avatar for skatamatic
0
239
Member Avatar for jbrock31

Hmmm when you use sizeof(), I would sugguest using the structure name instead of the structure being loaded. For example, if the structure was called sDirection: [code=cplusplus] file1.read ( reinterpret_cast<char*>(&north), sizeof(sDirection) ); [/code] I'm not to sure of the technicalities behind why that causes problems, but I know I've had …

Member Avatar for skatamatic
0
131
Member Avatar for sjhentges

kph should be a double. When you make consts, read the data type from right to left. const double kph_to_mph should be double const kph_to_mph. In your loop you are not really doing any calculating. Instead, you are displaying the initial value of kph * kph_to_mph. Since kph is uninitialized …

Member Avatar for skatamatic
0
77
Member Avatar for shopnobhumi

A tutorial isn't generally going to tell you how to make the program you want to make :P . Here's a simple prime function [code=cplusplus] bPrime = true; for (int ii(2); ii < _iVal / 2; ii++) { if (!(_iVal % ii)) { bPrime = false; break; } } [/code] …

Member Avatar for skatamatic
0
831
Member Avatar for newbie5150

At a glance I saw more than 15 syntax errors. I'm way too lazy to point those all out... you have [] around a cout statement - that would probably make a compiler explode. You have ; all over the place where they shouldnt be. You have a few instances …

Member Avatar for mrboolf
0
144
Member Avatar for afg_91320

[B]--what exactly does a parameter do? i know it passes a value to a function-but how is it always like that? or is it more complicated than that? is it kind of like passing a power in math?[/B] Im not sure what you mean by 'is it always like that'. …

Member Avatar for Ancient Dragon
0
98
Member Avatar for Sarlacc

You will need to look up the wav class implementation and headers assosciated with it. Different forms of wav (although not that many) require different headers. PCM is most common, so google WAV PCM C++. Then you can do a binary dump from the wave to the wav class members, …

Member Avatar for skatamatic
0
134
Member Avatar for afg_91320

remember that an array's max index is always 1 less than its size, since 0 is included. So for part 1, numberArray[0][0] = 148; and #2 numberArray [8][10] = 18;

Member Avatar for skatamatic
0
105
Member Avatar for Levio91

C++ can be a bit overwhelming to teach yourself. There's a lot of very specific syntaxes that you have got to get comfortable with first. I taught myself qbasic inside and out when I was about 12, which helps me immensely with c++, even though the languages are completely different. …

Member Avatar for freudian_slip
0
141
Member Avatar for Villanmac

Yikes. It's too hard to help you because I am totally unfamiliar with that particular chips op codes. And I'm not familiar with that header file either. Generally these forums are for windows/linux programmers. Does this need to be written in C++? Because if it can be written in assembly, …

Member Avatar for skatamatic
0
191
Member Avatar for DemonGal711

For problems like this, I would step through the code (via F10 to step through and F11 to step 'in' in VC++). Keep an eye on your local variable list, and as their values change make sure that they are changing as expected. If not, you can isolate the exact …

Member Avatar for DemonGal711
0
99
Member Avatar for afg_91320

Do it in a loop [code=cplusplus] for(int i(0); i < SIZE_OF_ARRAY; ++i) array1[i] = array2[i]; [/code]

Member Avatar for skatamatic
0
2K
Member Avatar for skatamatic

I'm interested in writing a memory scanning program (for cheating in games, looking for hidden processes, and such). I'm wondering if there's any way to do this with C++ without extensive knowledge of windows classes/programming. I'm thinking assigning a pointer to the first location of the processes stack or something, …

Member Avatar for zhouxuzhu1985
0
148
Member Avatar for DLightman

I would sugguest the vector class, since it does all the finicky dma for you. Use it like this: [code=cplusplus] #include <vector> #include <iostream> #include <algorithm> using namespace std; class flyer { char * _szType; int _iPriority; public: char * _szName; //add flyer data here (flight time? etc) //im not …

Member Avatar for skatamatic
0
270
Member Avatar for vladdy191

Think of arrays as pointers to the start of a stream of data. When comparing them, you are comparing the memory address of the first value of the array with the second. These will never be the same, unless one array references another. Basically it's a redundant test that shouldn't …

Member Avatar for skatamatic
0
93
Member Avatar for songkok

I imagine an ini file could be loaded from the same way any txt file could be loaded from, can it not? Although I bet there's probably some useful classes out there that have done the parsing for you.

Member Avatar for songkok
0
118
Member Avatar for JackDurden

[code=cplusplus] int list::recursion(int item, int position, node * temp = startPtr) { if (temp->next) { if(temp->item != item) recursion(iItem, position + 1, temp->next); } else position = -1; //not found flag return position; } [/code] I'm not sure if this will compile, or even work properly (lol). I hate doing …

Member Avatar for skatamatic
0
105
Member Avatar for flexy82rpq

Show some effort first please. Hint: To get an ideal hash index via modulus just do this: [code=cplusplus] int iIndex(x % MAX) [/code] where x is the value that your finding an index for, and MAX is the maximum index you want (ie the max size of the hash table …

Member Avatar for skatamatic
0
78
Member Avatar for andrewama

In some compilers (like VSC++) int is implied when only the const keyword is used (like you did). It is always safest to issue a datatype, however, since many compilers require it.

Member Avatar for grumpier
0
171
Member Avatar for Cardenio

It could be a hardware fault. Typical troubleshooting steps for this would include the following steps: 1. Reseating the current cd-rom drive to ensure it's not a simple connectivity issue. If this fails, 2. seating a known-working cd rom drive into the laptop to see if it works. If it …

Member Avatar for skatamatic
0
127
Member Avatar for vladdy191

Ints usually take up 4 bytes of memory, while chars only take 1. You can always cast them into one another, but this can cause undesired results when converting from int to char - some bits may be truncated, or in some compilers could cause a conversion error.

Member Avatar for skatamatic
0
148
Member Avatar for andrewama
Member Avatar for jbrock31

[QUOTE=jbrock31;723555]Hi everyone. I decided to try and learn C++ on my own and i have ran into a problem and i just need slight kick in the butt. :) I am just learning structures and i am practicing using some of the examples at the end of the chapter in …

Member Avatar for jbrock31
0
143
Member Avatar for localp

If you are using a c style null terminated string, you can cast them into an integer to display the ascii value, and just bias it however you feel. ie [code=cplusplus] int iUpperBias(64); //ascii for G(71) - 64 = 7 like you desire int iLowerBias(96) char * szString; //fill with …

Member Avatar for skatamatic
0
131
Member Avatar for NinjaLink

I'd recommend you either #ifdef #define something at the start of your .h file, or use a #pragma once line to ensure it isn't being included multiple times.

Member Avatar for NinjaLink
0
1K
Member Avatar for fireballnelson
Member Avatar for mercedesbenz

Logical AND - &&, Logical OR - ||, Logical Inversion - ! Some things you should get comfortable with.

Member Avatar for skatamatic
0
79
Member Avatar for kalou

This site's a good place to start. There's a whole tutorials section that you might find interesting.

Member Avatar for zhouxuzhu1985
0
106
Member Avatar for kotkata

I don't understand why you have a inStream >> next; statement before your while loop... The reason why you are getting such strange results when inputting is that you are inputting data past the end of file (ie loading in 100 values when the file only contains 16). Instead of …

Member Avatar for skatamatic
0
144
Member Avatar for Se7Olutionyg

Write a parsing program (something that splits a bigger data type ie. a ISBN number to a more manageable datatype ie. an array of char[]). Load in the ISBN number from the file, and make sure it doesn't contain more than 3 dashes (-), that it only contains numbers (other …

Member Avatar for skatamatic
0
189
Member Avatar for NinjaDude007

[QUOTE=NinjaDude007;722844]I am gonna start off saying that I am new to C++, and I have little programming knowledge (just Q Basic, and it has been a while since I have used that), and I need help on an assignment in my C++ class. We have to use a case function …

Member Avatar for NinjaDude007
0
176
Member Avatar for tatainti55

You can't really. The console isn't meant for that sort of shennanigans. You could make something horribly ugly (with a lot of effort) I suppose...

Member Avatar for tatainti55
0
52
Member Avatar for uim_1977
Member Avatar for n8thatsme

Your exit method should work, although a more effective method is, after the cin >> invoiceNum line, have a check against EXIT_CODE, and if it does exist, use a break; command to leave the for loop, then it should jump out of the while loop as well. There's a few …

Member Avatar for skatamatic
0
116
Member Avatar for skatamatic

I'm not sure I did this right. It's for an assignment for school where i'm supposed to return the author last name and the balance (described below) relating to each author. It's from the pubs database (I'm thinking that most people have used it for testing/learning before?) I'm an SQL …

0
89
Member Avatar for Ixeman

The people there already gave you pretty good advice. It's a program that does nothing, perhaps a header file? It requires libraries that aren't included with vb, so a direct translation isn't really feasible.

Member Avatar for skatamatic
0
56
Member Avatar for m_arian

Hmmm. Maybe you should include the code to make the program run? Also, I would sugguest using inheritance rather than unions for this (like ancient dragon said). Here's the drawer header my school usually uses, which is also our model for learning inheritance, as it demonstrates it quite nicely (as …

Member Avatar for skatamatic
1
127
Member Avatar for Boudou

That's the fifth time you've been asked to use code tags. I'm not going to help you anymore. I explained their syntax 4 times!

Member Avatar for skatamatic
-1
108
Member Avatar for shopnobhumi

The x/100 is an integer divide. So when 456 is divided by 100 = 4.56. Since it's an integer, the decimals (non-integer) are truncated (removed), so the first part of the cout (x/100) displays 4. Then the modulus operator divides x by ten and returns the remainder. 456 / 10 …

Member Avatar for skatamatic
0
75
Member Avatar for JackDurden

Im not sure I understand the problem. What is search supposed to be returning? True if the value a is found? Are you unsure what to put in the if statements? Please be more specific. I compiled your code and found it to be pretty broken in other places. I …

Member Avatar for skatamatic
0
68
Member Avatar for NinjaLink

I don't understand your function. It seems as though in the cout line, that getstock is recursively (and endlessly) calling itself. It doesn't even return any value that could be displayed if the recursion wasn't endless! I think you are meaning to call some sort of string from a member …

Member Avatar for NinjaLink
0
135
Member Avatar for Boudou

Please use code tags. This is the third time I have warned you about this. People generally feel less inclined to help if they have to spend triple the time understanding the scopes of the program and finding un-highlighted keywords. Again, the syntax is [ code = cplusplus ] code …

Member Avatar for Boudou
0
98
Member Avatar for Niner710

When you leverage off of the = operator without an overloaded ooperator=() implemented, the compiler uses a predefined method of copying the data by doing a direct member to member copy. Since you are using pointers as members, the addresses of the pointers are being copied, rather than firing the …

Member Avatar for skatamatic
0
171
Member Avatar for CollegeC++

Hmm please use code tags. And what was the actual question? Please post the specific part of your code that you are having issues with.

Member Avatar for skatamatic
0
117

The End.