6,741 Posted Topics

Member Avatar for ZombieCoder

>The interview needs to be by phone Good luck with that. Anyway, why does it need to be by phone when email or public forum is perfectly suitable and more likely to be acceptable to most?

Member Avatar for sidatra79
0
207
Member Avatar for JoeRoss578

You only fill exercise[0]. Perhaps this would work better for you: [code=cplusplus] for (i = 0; i < 5; i++) { cin >> exercise[i]; cout << exercise[i] << endl; } [/code]

Member Avatar for sidatra79
0
203
Member Avatar for J-son

Let's say you have a row of beers[1] and you're looking at the first one. Oh, your name also happens to be ptr. Nice to meet you Mr. Ptr. Here's the game: You want the first beer, so you try to drink from it. Let's say that to drink from …

Member Avatar for J-son
0
133
Member Avatar for cutedipti

>Global, static, and local variables were often stored in the stack Kinda sorta. An accurate description (as required by my standard nazi status) is that you essentially have three options: automatic, static, and dynamic. Automatic is pretty much always implemented using a runtime stack, which is why people talk about …

Member Avatar for Narue
0
208
Member Avatar for blade_costic
Member Avatar for slanker70

Labels don't introduce a new scope. This error tells you that jumping into the switch can (or does) ignore the definition of the object even though it's still in scope. I'm sure you can imagine what would happen if you try to use an object that doesn't physically exist. A …

Member Avatar for Salem
0
100
Member Avatar for JimD C++ Newb

Well, you didn't show any of your tree, so the best I can do is link you to a tutorial I feel is good: [url]http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_bst1.aspx[/url]

Member Avatar for JimD C++ Newb
0
109
Member Avatar for Freaky_Chris

Post a complete program that exhibits the problem, please. Also post the exact error message rather than summarizing.

Member Avatar for Freaky_Chris
0
276
Member Avatar for noobguy

>I posted a question that I needed help with about 4 hours ago Don't let our usual efficiency fool you. This is a volunteer service, so you should have no expectations about how long it takes to get an answer, or the quality of the answer. >Is it that the …

Member Avatar for Narue
0
98
Member Avatar for RouseA

GCC is correct, your other compiler is not. >Can anyone explain the problem? The order of operations for function-like macro parameters (as per section 6.10.3.1 of the C standard) is to identify the parameters, then replace any macro parameters, then substitute the parameters with actual arguments. The order you expected …

Member Avatar for ahamed101
0
221
Member Avatar for unbeatable0

If you can't fit the value into a long int or a long double (or long long, if your compiler supports), you need some kind of arbitrary length arithmetic type, which isn't native to C++.

Member Avatar for dmanw100
0
129
Member Avatar for PuQimX
Member Avatar for TheBeast32
Re: Goto

>Why is it a bad practice to use it? Laziness. Most of the time, people who use goto are too lazy to consider all of the alternatives and choose the best solution. They fall back on goto, but because they're lazy, they don't use it wisely and the result is …

Member Avatar for Narue
0
126
Member Avatar for joelogs

Let me guess, you don't know anything about C, you've never programmed before (but this app is going to be AWESUM!!!!!) and want someone to do it for you on your state of the art version of Turbo C 1.0. :icon_rolleyes:

Member Avatar for Freaky_Chris
0
185
Member Avatar for it2051229

Did you link with user32.lib as well, or just include windows.h? Headers contain the necessary declarations for your code to compile, but for the code to link, you need the corresponding definitions as well. Those definitions are usually stored in an static object library file, or a dynamically linked library …

Member Avatar for Narue
0
117
Member Avatar for CobraEatr

Check the code snippets section. IIRC, you'll find examples that can be combined to do everything you want.

Member Avatar for Narue
0
123
Member Avatar for less123

>where will be the temp.txt written to ? Most likely the current working directory >how can we change the written location of the temp.txt ? Change the current working directory, or specify an absolute path rather than a relative path.

Member Avatar for Narue
0
47
Member Avatar for cutedipti

>Yes it is possible Correct. >but the code will be large enough and not good from good programmers view Um, how do you think printf was written? Granted, cutedipti probably doesn't compare to the quality of programmer that writes the standard library code, but suggesting that the code won't be …

Member Avatar for Narue
0
128
Member Avatar for VernonDozier

>Is there a better way? Yes, design the class hierarchy such that you don't need to know the dynamic type of the object. Perhaps some form of strategy pattern would clean up that selection code.

Member Avatar for VernonDozier
0
261
Member Avatar for tatainti55

>How do i export integers to another function? Ideally you would import values through parameters and arguments, and export values through the return: [code=cplusplus] #include <iostream> int foo() { return 10; } void bar ( int import ) { std::cout<< import <<'\n'; } int main() { bar ( foo() ); …

Member Avatar for tatainti55
0
105
Member Avatar for rockstarpirate
Member Avatar for Emily0415

I'm moving this to the Geeks' Lounge as it really has nothing to do with game development.

Member Avatar for itdupuis
0
47
Member Avatar for killdude69

Unresolved symbol errors typically mean you aren't linking with the correct libraries. Those symbols are all part of the Win32 API, so your project settings for external libraries are probably incorrect.

Member Avatar for killdude69
0
242
Member Avatar for gparadox

>My output right now is saying everything is out of the language. I'd start with the fact that you aren't actually parsing the given grammar. Consider two examples: 1) The grammar states that a term by itself is a valid expression, but your expression function doesn't implement this behavior. In …

Member Avatar for gparadox
0
119
Member Avatar for meddlepal
Member Avatar for chunalt787

[code=cplusplus] template<typename T> LinkedQueue& LinkedQueue::operator=(const LinkedQueue& queue) { ll = queue.ll; return *this; } [/code] You need to be more careful about specifying template parameters: [code=cplusplus] template<typename T> LinkedQueue<T>& LinkedQueue<T>::operator=(const LinkedQueue<T>& queue) { ll = queue.ll; return *this; } [/code]

Member Avatar for chunalt787
0
266
Member Avatar for guy40az

Try it and see. It's not like a simple experiment will take any longer than it took to create this thread.

Member Avatar for Narue
0
41
Member Avatar for cutedipti

>it's basically okay to write big functions recursive, large functions iterative What if I want to write a large function recursive and a big function iterative? :D

Member Avatar for Narue
0
98
Member Avatar for rysin

>I thought it would return the value of x since x is in both statements and yet it doesnt. Interesting reasoning. The reason it doesn't return x is because a boolean expression will always result in a boolean value (true or false).

Member Avatar for Sci@phy
0
98
Member Avatar for Aus89

It's best to think of the preprocessor as a completely different language than C. In particular, #define statements do not generally end with a semicolon because the semicolon is considered to be a part of the replacement text. This is what your compiler sees: [code=c] int mem[64000;]; int frames[6400;]; [/code] …

Member Avatar for Narue
0
121
Member Avatar for champ80

You've found the easiest way to do it. Read each line into a record, break the record up into fields, append the record to an array of records, and sort the array by your chosen field. If you have a lot of records, use a faster sorting algorithm such as …

Member Avatar for emotionalone
0
586
Member Avatar for serkan sendur

>what is difference between the final binary output of the same program >written in c and written in an assembly if they do exactly the same thing. Hand-crafted assembly written by a skilled assembly programmer will probably be more optimized than the object code produced by a compiler. >if they …

Member Avatar for Ancient Dragon
0
333
Member Avatar for rysin

>How am I supposed to remember that??? When you use it often enough, remembering becomes simple. In fact, if you program for long enough, you'll actually develop muscle memory for typing out your template and won't have to remember. ;) >If you wouldnt mind could you explain what the includes …

Member Avatar for rysin
0
104
Member Avatar for anny**

The %c specifier doesn't ignore leading whitespace. And for future reference, it's %c, not %ch. %ch looks for a single character and then 'h'.

Member Avatar for Narue
0
152
Member Avatar for buffcubby

>even if I comment out the push and pop calls it will still display the right numbers Clearly. Your use of the stack is effectively a no-op because you push eax onto the stack, then immediately pop the value off of the stack and back into eax. The state of …

Member Avatar for Narue
0
90
Member Avatar for allopiloping

Long, or System.Int64. Are you incapable of cracking a book or searching the web? We're not your personal reference, you know, and questions like this are easily answered on one's own.

Member Avatar for chan_lemo
0
76
Member Avatar for adrian116

>1. const int* a; (what the difference between const int *a and why pointer need to be const?) Whitespace makes no difference here. [ICODE]const int* a[/ICODE] and [ICODE]const int *a[/ICODE] are identical. The pointer is not const, it points to an object that is const. To make a pointer const, …

Member Avatar for adrian116
0
105
Member Avatar for ShadowOfBlood

>I finished the program and it works, but my teacher's very picky about efficiency. Your program is I/O bound. The time it takes for a user to type a number and the time it takes to print the output will vastly overwhelm any processing efficiency. I recommend that you focus …

Member Avatar for Narue
0
183
Member Avatar for t_s

When you use an array name, it's converted to a pointer to the first element. That's why this works: [code=cplusplus] int arr[10]; int *p = arr; [/code] By a rights and purposes, an array shouldn't be compatible with a pointer and the assignment should fail. But because arr is converted …

Member Avatar for t_s
0
115
Member Avatar for Melab

>I'm looking for a very easy to use compiler That's the crux. IDEs are generally more difficult to use because they combine the myriad tools you would be using along with a command line compiler. I'd say that [URL="http://www.codeblocks.org/"]Code::Blocks[/URL] is probably the easiest to get started with. [URL="http://www.microsoft.com/express/vc/"]Visual C++ 2008 …

Member Avatar for Narue
0
83
Member Avatar for sunveer

Since you didn't give nearly enough information, or provide even a rudimentary attempt, this is all you get. Here's how a real-world programmer would do it: [code=cplusplus] #include <algorithm> #include <string> std::string s = "hello"; std::reverse ( s.begin(), s.end() ); [/code]

Member Avatar for Narue
0
169
Member Avatar for Ellisande

>error: cannot convert ‘std::ifstream*’ to ‘char**’ for >argument ‘1’ to ‘__ssize_t getline(char**, size_t*, FILE*)’ That looks like your compiler is trying to call the wrong function. Try prefixing getline with std:: to force name lookup to check the std namespace.

Member Avatar for Ellisande
0
191
Member Avatar for Jennifer84

I don't want to sound mean, but you should try a different method of study, or perhaps consider that you may not be suited to programming. I've watched you ask questions for months without making any progress at all, and it's kind of depressing.

Member Avatar for Jennifer84
0
117
Member Avatar for onemanclapping

>that's good! I just need to declare it as public It's rather depressing how you latched on to the [I]worst[/I] possible option that stilllearning suggested.

Member Avatar for onemanclapping
0
115
Member Avatar for scotchfx

If you don't explicitly delete your memory, it doesn't get deleted. >will this become a memory leak for whomever Yes, yes it will.

Member Avatar for Narue
0
131
Member Avatar for manzoor
Member Avatar for tondet2

Do you mean you want the values to be variable yet still persistent across runs of the program?

Member Avatar for ahamed101
0
90
Member Avatar for Ellisande

strcmp doesn't return true or false, it returns a comparison: <0 - The first string is "smaller" than the second string >0 - The first string is "greater than the second string 0 - The strings are "equal" In your test [ICODE]strcmp(argv[5], "yes") && strcmp(argv[5], "no")[/ICODE], you're saying evaluate to …

Member Avatar for Narue
0
97
Member Avatar for totalnoob

>fread (&temp,amount*sizeof( *z_array ), 1 ,binaryfile); temp is a float. Read your reference on fread again, double check the actual values you're passing it, and you'll see a problem.

Member Avatar for totalnoob
0
79
Member Avatar for En-Motion

>always exits after 2 guesses abd says the guess was correct even if it's wrong Not necessarily. If you enter 10, then 70, you get three guesses. By the look of things, the correct message won't print unless the guess really is correct, but you only ever have one iteration …

Member Avatar for En-Motion
0
101

The End.