166 Posted Topics

Member Avatar for jaymayne

Furthermore, it should be `int main()` not, `void main()`, and you should have `return 0;` at the end of your program.

Member Avatar for jaymayne
0
120
Member Avatar for SillyNoob

One issue is here: `&(*mPntr)` The other is here: `&PntrFunc(&(*mPntr))` You can't get the location of `*mPntr`, because that's an expression, so your code doesn't make any sense. It would be like if you were to try to do this: `int* ptr = &(a + b);` It's obvious to see …

Member Avatar for SillyNoob
0
234
Member Avatar for subith86

> Use a new version of the compiler with the bug fixed I suggest this one, because ideally a compiler shouldn't crash no matter what you feed it.

Member Avatar for mitrmkar
0
3K
Member Avatar for nuclear

Java has the advantage that is has a virtual machine that runs under many Operating Systems. Like so, you can expect many things to work on as well on under OSx as you are under Linux and Windows (more or less). I don't really understand the point of C# though. …

Member Avatar for mike_2000_17
0
162
Member Avatar for mitchfizz05

> You can use Adobe Flash to make an app. How can he use Adobe Flash to make an iOS app, when iOS doesn't support Flash? Apple pretty much has the whole App-making thing locked down to where you can't produce any iOS app without owning an Apple computer. From …

Member Avatar for mitchfizz05
0
114
Member Avatar for f4fjks

You're probably creating a text file, but then you're just *naming* it like a PDF. Just changing the file extension doesn't change the data inside the file, it's still just text. That would be like calling your chicken a pig, slaughtering it, and expecting it to taste like pork. > …

Member Avatar for NathanOliver
0
251
Member Avatar for orar

You first issue is on the lines that say `cin >> people.fname >> people.lname;` and `cout << people.fname << people.lname;`. The token `people` refers to the type of the structure, not its name, so this results in a syntax error. Since it's a member function, change these lines to `cin …

Member Avatar for orar
0
374
Member Avatar for hwoarang69

GBA programming seems like a hassle because you would have flash it to a cartradge, and deal with the GBA's various limitations. I'll throw SDL's hat in the ring, as always: http://www.daniweb.com/software-development/cpp/threads/418882/game-design-classes-and-inheritance/1#post1786924

Member Avatar for Tumlee
0
175
Member Avatar for pattmorter

> So would this be correct then? Close, but remember that `return` statements immediately exit your funciton, so the way you wrote your code, `tf` would never be set unless `value1` and `value2` are equal. You want to swap the `return`s and the setting of `tf`.

Member Avatar for pattmorter
0
218
Member Avatar for enkitosh

SFML still has some maturing to do. The last time me and my friend tried to make something with it, it turned out it didn't even support certain computer architectures. In the meantime, I suggest using SDL, and it's extensions, SDL_mixer and SDL_image, to make a game. With the proper …

Member Avatar for Serapth
0
362
Member Avatar for newbie14

As said above, you need to call `fclose(ftdata);`. To prevent future headaches, your third argument (count) should be set to 4 instead of 2 if you want to fully print `"TEST"`.

Member Avatar for Tumlee
0
84
Member Avatar for Chuckleluck
Member Avatar for raptr_dflo
0
303
Member Avatar for coolbits

You are calculating the maximum value correctly, but you are forgetting to actually print it to the screen. The following should print your value. [code=C++]cout << "The maximum value is" << Max(s,n) << endl;[/code]

Member Avatar for coolbits
0
147
Member Avatar for a.muqeet khan

In your declaration of [icode]mergesort()[/icode], you are giving it two arguments. [code=C++]int mergesort(int,int);[/code] But when you actually define the function, you gave it three. [code=C++]int mergesort(int first,int last,int mid)[/code] That is a mismatch, and it results in the linker error you ended up with. You fix this by changing either …

Member Avatar for Tumlee
0
165
Member Avatar for cali_kid

This is definitely one issue: [code=C++]printf("max = %d\n", max); printf("min = %d\n", min);[/code] [icode]max[/icode] and [icode]min[/icode] are not integers, they are functions that return integers, so these lines of code don't make any sense. I'm not even sure how you got this to compile, but your program is probably printing …

Member Avatar for Tumlee
0
203
Member Avatar for jnmisa

I actually found it Visual Sudio's "Intellisense" irritating when it was pestering me, putting red underlines on all my code and giving me suggestions when I wasn't done writing my program yet. I prefer CodeBlocks because it's still an IDE that allows you to easily manage a large project, but …

Member Avatar for jussij
0
157
Member Avatar for tom12

Are you trying to just turn the vowels into spaces? If so, your code works perfectly on my end.

Member Avatar for tom12
0
90
Member Avatar for emreozpalamutcu

The header you're looking for is [icode]<dirent.h>[/icode], which allows you to use the [icode]opendir()[/icode] function. That function opens a specific folder and allows you to iterate through all the files in that folder and view their names and sizes. If you look up tutorials on using that library, you'll find …

Member Avatar for Tumlee
0
193
Member Avatar for Labdabeta

If the algorithm was "simple" it probably wouldn't compress very well. If it helps you understand better, many compression algorithms actually [i]can[/i] end up making a chunk of data larger if it's not suited for the task (notice how sound files don't compress very well at all with ZIP compression).

Member Avatar for Labdabeta
0
250
Member Avatar for man0987

No, the code is not correct at all. It's not supposed to be [icode]<iostream.h>[/icode], it's just supposed to be [icode]<iostream>[/icode]. You shouldn't be using <conio.h> at all, because that just allows you to use old DOS-isms that can be done in a more portable way. You're not supposed to use …

Member Avatar for Tumlee
0
201
Member Avatar for qualt

There is no such thing as an EXE that will run under all machines. Turbo C makes DOS programs. DOS compatibility has been whittling away on Windows (and for good reason). There is no guarantee that your program will work perfectly under any operating system newer than Windows 98, unless …

Member Avatar for qualt
0
347
Member Avatar for triumphost

There is no difference unless you're using a class that detects the type of the data and does something different with it depending on that type. For code clarity, you should use 0 when talking about a number, '\0' when talking about a string-terminator, and NULL when talking about a …

Member Avatar for mrnutty
0
234
Member Avatar for mrprassad

He's expecting the compiler it to align all instances of this structure to 4-byte boundaries via padding. I'm not entirely sure if this should actually change the value returned by sizeof().

Member Avatar for gusano79
0
90
Member Avatar for Peter4n31

[QUOTE=Peter4n31;1746735]"Just make an empty method" I would need a little help. How to do it ? (I know it sounds stupid but I haven't touched c++ in 10 years...)[/QUOTE]You would just make a function put nothing in the brackets except for a [icode]return;[/icode] statement in this case. If the function …

Member Avatar for Peter4n31
0
372
Member Avatar for ichigo_cool

When I make an SDL program (compiled under Windows 7), it doesn't require any such DLL even under Windows XP. Ichigo, would you happen to be building your game under Microsoft Visual C++? I know that even terminal programs made with that compiler require that DLL for some reason --- …

Member Avatar for Tumlee
0
460
Member Avatar for swissknife007

If you want to create a program in C or C++ with graphics, you should first switch to a modern IDE (like Code::Blocks or Visual C++). From there, you should learn how to a library like OpenGL, SDL, DirectX, or something similar.

Member Avatar for DeanMSands3
0
843
Member Avatar for Zssffssz

Why use [ICODE]while(0==0)[/ICODE] when you could just use [ICODE]while(true)[/ICODE]? Furthermore, why would you use a do-while loop when your condition is infinite?

Member Avatar for MastAvalons
0
139
Member Avatar for paulmcco

Most environment/compilers require a newline at the end of your file, otherwise it won't compile. Some will even go as far as to add them in [i]for[/i] you. Try adding it in and see if that resolves the problem.

Member Avatar for nezachem
0
437
Member Avatar for khajvah

C++ and C are just as capable as any other language when it comes to using the internet, networking, etc. There are all sorts of libraries out there to do that sort of thing. Even C can have, for example, a game that uses UDP that can be used for …

Member Avatar for zeroliken
0
256
Member Avatar for lolwaht

[quote=firstPerson][code=C++]struct{ const int EAST = 0; const int SOUTH = 1; const int WEST = 2; const int NORTH = 3; };[/code][/quote]Who in God's name would use a struct like [i]that[/i]? That is [i]not[/i] what structs are there for. The [ICODE]enum[/ICODE] keyword is for where you want to have different, …

Member Avatar for mrnutty
0
97
Member Avatar for nuclear

What happens if you hold the up button? It looks to me like Lazyfoo forgot to add a check to make sure the dot wasn't on the ground. It will therefore occur that when you press the up button in a higher framerate, it will be down for more "ticks" …

Member Avatar for mike_2000_17
0
152
Member Avatar for lucyaurora

Are you talking about before your class is finished, or in the long term? If it's the latter, I recommend starting simple, like with a 2D game with simple sound effects. I highly recommend learning how to use the SDL library for this, as it has some pretty simple methods …

Member Avatar for LdaXy
0
467
Member Avatar for Techwriter10

Seems more like a user issue. I've had Vista for three straight years and the boot time has stayed a static 15 seconds for me. The Allow & Deny thing only happens the very first time you run a program, so that's not an issue. Windows 7 is officially more …

Member Avatar for pacav69
0
468
Member Avatar for rajatchak

(Good God, why does everybody here beat around the bush when somebody has a problem, just help the guy!) What I would do in your situation is to monitor all the variables involved (you don't even need a debugger for this, just make it print your variables in a loop). …

Member Avatar for rajatchak
0
215
Member Avatar for subith86

[ICODE]new[/ICODE] uses brackets, not parenthesis. Furthermore, it's called [I]allocating[/I] memory, not [I]occupying[/I] it. [code=C++]char* temp = new char[255]; temp = "poiuytrewq";[/code]

Member Avatar for subith86
0
179
Member Avatar for Taino

[ICODE]string compliments[4] = {"String 1", "String 2", "String 3", "String 4"};[/ICODE]This will create an array of strings that you can output. If you're going to use the [ICODE]string[/ICODE] class, you're going to need to include the proper header, which I believe is either called [ICODE]<string>[/ICODE] or [ICODE]<strings>[/ICODE]

Member Avatar for mikrosfoititis
0
124
Member Avatar for mahavairavan

In the comments you'll see some potential problems with this code. [code=C]#include<stdio.h> #include<string.h> int main() { //You're intializing a two dimensional array with a one-dimensional initializer. //This may cause problems. char a[4][4]={'j','u','s','t'}; int i,l,j,k,b=4,n; //If b is the number of characters, why not name it numchars or something like that? …

Member Avatar for Tumlee
0
1K
Member Avatar for rithish

Exactly who keeps telling people to keep using Turbo C? Is there some antiquated book from the 1980's floating around and encouraging this? I'm assuming it's the same people telling everybody to use [ICODE]void main()[/ICODE].

Member Avatar for Schol-R-LEA
0
409
Member Avatar for Thermalnuke

There's a semicolon after your while statement on line 43. You need to get rid of that thing or your program will never work correctly. When you have a while loop with a semicolon after it your loop will do nothing except increment counters. At line 59, the statement [ICODE]else …

Member Avatar for Thermalnuke
0
182
Member Avatar for itzcarol

[QUOTE=;][/QUOTE] First of all, you're not using your characters and integers consistently at all. It's going to cause you a lot of confusion in the future. The character [ICODE]'1'[/ICODE] is not equal to the number [ICODE]1[/ICODE] In [ICODE]readAndValidateUserMove()[/ICODE], there is really no need to use [ICODE]tolower()[/ICODE] on the input because …

Member Avatar for Tumlee
0
252
Member Avatar for UNDER-18 FG

[QUOTE=;][/QUOTE] [code=C]Scanf("((%d/%d)*%d)", &Mark1, 40, 100;[/code] You're also missing a parenthesis at the end here. It should be: [code=C]scanf("((%d/%d)*%d)", &Mark1, 40, 100);[/code]

Member Avatar for UNDER-18 FG
0
153
Member Avatar for steffisusan

[QUOTE=;][/QUOTE] [ICODE]result = SaveAudioFile(pFileName);[/ICODE] Are you sure a JPEG is supposed to be an Audio file? Furthermore, what libraries are you getting all of these functions from?

Member Avatar for Tumlee
0
147
Member Avatar for happygeek

That raises an interesting question: Once (if?) tablets become more popular for Windows users, how will that affect already existing software? Can we expect to see popular software redesigned with bigger buttons, or retooled to take advantage of multi-touch touchscreens? What about free libraries, like SDL (which has been in …

Member Avatar for Tumlee
0
553
Member Avatar for jonspeidel

Yeah, main() should never be called. I'm actually surprised that the compiler didn't yell at you for something like that, in many environments it's not even legal C. You should also not have to prototype main(). Once that code gets fixed, however, you might have problems because I'm not entirely …

Member Avatar for WaltP
0
253
Member Avatar for gourav1

An array is just a pointer. The only difference is that arrays always point to the same memory and will have a static number of elements. [code=C]int main(int argc, char** argv) { int* ptr; //A pointer to an int. int array[4] = {2, 4, 6, 8}; //A static array. int …

Member Avatar for gourav1
0
131
Member Avatar for iamthesgt

When you use #include <blah.h>, that doesn't mean you're actually using the libraries, those are just guides so the compiler knows what functions and variables exist outside of your own program. You need to actually [I]link[/I] them, or you're going to get all kinds of errors like the ones you …

Member Avatar for iamthesgt
0
274
Member Avatar for pato wlmc

[I]i[/I] is used probably because it stands for [I]iteration[/I]. People choose to use it because [I]i[/I] is short and it looks clean when you use it as an array index (compare array[i] to array[numloops]).

Member Avatar for Tumlee
0
5K
Member Avatar for subith86

This is precisely why many C++ guides advise against using the equality operator with floating point values, because it can give you headaches like this. firstPerson's solution is okay for most applications. float == 0.0 is one of the few values for which it will work 100% of the time.

Member Avatar for Tumlee
0
203
Member Avatar for zeroliken

[quote]...by this I mean you should never use a break statement in anything other than a switch[/quote]I agree with most of the stuff you said, but certainly not this. You should [I]avoid[/I] using a break statement in for loops when you can, but there are an awful lot of cases …

Member Avatar for zeroliken
0
501
Member Avatar for mrnutty

Impressive, but: 1) Bases zero and one cannot possibly exist, nor could it produce any sort of sensical output nor input. 2) Using "int" will more than likely limit you. That's only four bytes in most environments, or eight hex characters. You should probably use the int64_t type.

Member Avatar for Tumlee
0
690

The End.