• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

C++ Help?

Status
Not open for further replies.
edit: eyes deceived me, nvm.


this line:
printf("Lowest Pressure: %f Lowest Temperature: %f\nHighest Pressure: %f Highest Temperature: %f\n", pressure[1], temp[1],pressure[10], temp[10]);

should be:
printf("Lowest Pressure: %f Lowest Temperature: %f\nHighest Pressure: %f Highest Temperature: %f\n", pressure[0], temp[0],pressure[10], temp[10]);

since C arrays are 0-indexed, meaning the first element is element 0. So eg. my_array[0]...my_array[9] is an array of size 10.


although I think sorting the arrays is overcomplicating the solution. you're only being asked to display the lowest and highest values which you can do with a simple for.. loop, overwriting a variable like "highest_temp" each time a new highest is encountered. etc. for lowest (you could do this in the same loop even)
 

Zeppelin

Member
I'm back again with more C-language trouble. You've been warned, this code is beyond messed up and doesn't come close to what I need it to do.

I have to make a program to record the temperature and pressure values and store the data in 2 separate arrays. After inputting the data, I need to identify the most extreme measurements from each array (Temperature: Hottest and Coldest, Pressure: Greatest and Least). Then I need the program to print to the screen those extremes. Oh, and each array has 10 elements.

First of all, you don't need to sort the arrays for this. Just iterate through them and keep track of the lowest and highest values you've found so far. And even if you want to sort the arrays I really don't understand why you have two sort functions that does the exact same thing. Just use the same one to sort both arrays.

Edit: Beaten.
 
Ok, I wasted three hours of my life and I'm back to square one. All I want to do is create a file if one doesn't exist. Once it creates the file, I want it to have ten rows of 1's. I can get it to create a blank file, but I can't reopen it later without it deleting everything inside. I search the internet for answers but all I found were nocreate, noreplace, which are the opposite of what I want. All of the other flags do not suit my needs, any ideas?

int loadStudentFile()
{
string firstName,
lastName,
fileName,
underScore = "_",
extension = ".txt";

cout << "Hello, what is your First Name?" << endl;
cin >> firstName;
cout << "\nOk " << firstName << ", what is your Last Name?" << endl;
cin >> lastName;
fileName = (firstName + underScore + lastName + extension);
fstream outputFile;
outputFile.open(fileName);

// What I ultimately want it to do is create a new file if one doesn't already exist with ten rows of 1's. If the file already exists, I don't want it to overwrite an existing file's data.

outputFile.close()
cout << "\nWelcome " << firstName << " " << lastName << "!\n" << endl;
cout << "Let's get started!\n" << endl;
// Call Another Function Eventually
return 0;
}
 

dabig2

Member
Ok, I wasted three hours of my life and I'm back to square one. All I want to do is create a file if one doesn't exist. Once it creates the file, I want it to have ten rows of 1's. I can get it to create a blank file, but I can't reopen it later without it deleting everything inside. I search the internet for answers but all I found were nocreate, noreplace, which are the opposite of what I want. All of the other flags do not suit my needs, any ideas?

You should be able to use the flag:

ios:app

to preserve the contents of the file. ios:app appends the data to the file. If the file doesn't exist, this flag also creates the file for you.

You want something like this:
Code:
outputFile.open(fileName, ios::out|ios:app);

This will make certain that data will only be written to its end, thus preserving the previous contents
 
You should be able to use the flag:

ios:app

to preserve the contents of the file. ios:app appends the data to the file. If the file doesn't exist, this flag also creates the file for you.

You want something like this:
Code:
outputFile.open(fileName, ios::out|ios:app);

This will make certain that data will only be written to its end, thus preserving the previous contents

Got it to work.

New question : How do I find the location of the minimum/maximum value within an array.
Here's how to find the minimum/maximum; however, where is that minimum/maximum stored at?

{
int lowestValue = levelValue[0];
int highestValue = levelValue[0];
for (int loopCounter = 0; loopCounter < 10; loopCounter++)
{
if (levelValue[loopCounter] < lowestValue)
lowestValue = levelValue[loopCounter];
if (levelValue[loopCounter] > highestValue)
highestValue = levelValue[loopCounter];
}
cout << "The lowest Value is " << lowestValue << "and is stored in " << //location << endl;
cout << "The highest Value is " << highestValue << "and is stored in " << //location << endl;
return 0;
}

Neither my programming book or the internet programming forums seems to have an answer.
 
Got it to work.

New question : How do I find the location of the minimum/maximum value within an array.
Here's how to find the minimum/maximum; however, where is that minimum/maximum stored at?



Neither my programming book or the internet programming forums seems to have an answer.

in your for loops, just have two extra variables eg. lowIndex and highIndex, then every time you overwrite eg. lowestValue also make lowIndex = loopcounter. same for highest.

edit: also your code is hard to read, you should be indenting, and use blank lines to separate different code sections. For example I would write it more like this:

Code:
int lowestValue = levelValue[0];
int highestValue = levelValue[0];
int lowIndex = 0;
int highIndex = 0;

for (int loopCounter = 0; loopCounter < 10; loopCounter++)
{
     if (levelValue[loopCounter] < lowestValue)
     {
          lowestValue = levelValue[loopCounter];
          lowIndex = loopCounter;     
     }

     if (levelValue[loopCounter] > highestValue)
     {
          highestValue = levelValue[loopCounter];
          highIndex = loopCounter;
     }
}


unles forum formatting is losing your indents, but you should still blank-line separate, for your own sake.
 
in your for loops, just have two extra variables eg. lowIndex and highIndex, then every time you overwrite eg. lowestValue also make lowIndex = loopcounter. same for highest.

edit: also your code is hard to read, you should be indenting, and use blank lines to separate different code sections. For example I would write it more like this:

-snip-

unles forum formatting is losing your indents, but you should still blank-line separate, for your own sake.

Yeah, when I hit submit, everything became left justified and squished together. I never noticed the # button during reply. I'll be using that in the future. Thanks for your help, I got it working.
 

Blizzard

Banned
I already posted this in the indie game development thread, but maybe there are some C++ template experts here. I have used C/C++ for many years, but I tend to avoid templates like the plague.

I am trying to use a GUI callback method. I already have some lower-level code that provides a template method, but I want to use that lower-level code as one particular implementation of a generalized manager class.

However, C++ does not allow template methods to be virtual, so I cannot provide the template method in the superclass and override it in the actual implementation subclass. Does anyone have a recommendation on a solution? Making a very simple CallbackWrapper template class and providing that as an argument to the virtual methods that need callbacks seem like the simplest approach to me. But, I guess I still could not use the wrapper as an argument since it would itself be a templated object? Bah. :(

The reason I need a template method is that otherwise I would be restricted to pure function (non-method) callbacks, as far as I am aware.
 
I already posted this in the indie game development thread, but maybe there are some C++ template experts here. I have used C/C++ for many years, but I tend to avoid templates like the plague.

I am trying to use a GUI callback method. I already have some lower-level code that provides a template method, but I want to use that lower-level code as one particular implementation of a generalized manager class.

However, C++ does not allow template methods to be virtual, so I cannot provide the template method in the superclass and override it in the actual implementation subclass. Does anyone have a recommendation on a solution? Making a very simple CallbackWrapper template class and providing that as an argument to the virtual methods that need callbacks seem like the simplest approach to me. But, I guess I still could not use the wrapper as an argument since it would itself be a templated object? Bah. :(

The reason I need a template method is that otherwise I would be restricted to pure function (non-method) callbacks, as far as I am aware.

look up boost::function, or see if your compiler supports std::function
 

Blizzard

Banned
Hoo boy, I'd rather not have to use those. I'm actually using a library that was rewritten to REMOVE boost for faster compilation times and lower sizes and whatnot.

Thanks for the suggestions though. Any other options?
 
Hoo boy, I'd rather not have to use those. I'm actually using a library that was rewritten to REMOVE boost for faster compilation times and lower sizes and whatnot.

Thanks for the suggestions though. Any other options?

What about std::function? Assuming your compiler supports it, it's part of the standard library, so shouldn't be an issue right?
 

Blizzard

Banned
I think I can avoid templates entirely by making an abstract GUICallback class with an Execute(GUICallback::GUICallbackData* pData) method. Then I can simply require that any GUI callback that I write is a subclass of that simple abstract class.
 

wolfmat

Confirmed Asshole
I think I can avoid templates entirely by making an abstract GUICallback class with an Execute(GUICallback::GUICallbackData* pData) method. Then I can simply require that any GUI callback that I write is a subclass of that simple abstract class.

Yeah, that's what I usually do as well. You could also just stick to base classes, and extend. That's the first generalization in terms of polymorphism, and it does the job if you're just writing this one project and that's it.

You should be able to determine what's better if you're asking yourself whether you want to change code a lot / interface with an unknown outside world or not. Meaning that if you want to write a set of utility classes that are going to be reused elsewhere, it's better to go abstract, for example.
 

Blizzard

Banned
This is code for what is intended to be a generalized game engine, and I want to be able to write multiple games with multiple GUI's that use callbacks. So yes, I think I will stick with the abstract GUICallback class especially since I should be relatively simple to extend it by writing the Execute method and extending the callback data object.
 
I think I can avoid templates entirely by making an abstract GUICallback class with an Execute(GUICallback::GUICallbackData* pData) method. Then I can simply require that any GUI callback that I write is a subclass of that simple abstract class.

Yes, although this has its own set of unfortunate side effects. For starters, it's pretty inconvenient to make an entirely new class whose sole purpose is to implement one function. It also means that class can't access private data of another class, which is often quite useful. For example, suppose you've got some window, it issues a request and wants notification when the operation is complete. If you do this callback as part of another class as you've proposed, the callback can't access private data of the window who wanted the request in the first place, which is a perfectly reasonable thing to want to do.

Honestly, std::function is the most elegant and flexible way to do what you want, doesn't require boost, doesn't require templates, and will ultimately end up in you having to write less code.

At a conceptual level, you're trying to solve the following problem - "I have an operation that I want to be able to invoke an arbitrary callback". That's exactly the problem std::function solves, I can't think of a reason not to use it unless you aren't using STL at all.
 

wolfmat

Confirmed Asshole
Yes, although this has its own set of unfortunate side effects. For starters, it's pretty inconvenient to make an entirely new class whose sole purpose is to implement one function. It also means that class can't access private data of another class, which is often quite useful. For example, suppose you've got some window, it issues a request and wants notification when the operation is complete. If you do this callback as part of another class as you've proposed, the callback can't access private data of the window who wanted the request in the first place, which is a perfectly reasonable thing to want to do.

That's what the observer pattern is for, but the boilerplate stuff isn't exactly awesome, you're right on that one.
 

maharg

idspispopd
Hoo boy, I'd rather not have to use those. I'm actually using a library that was rewritten to REMOVE boost for faster compilation times and lower sizes and whatnot.

Thanks for the suggestions though. Any other options?

boost and the standard library (even in C++11) are orders of magnitude apart in terms of code size. Please don't 'avoid templates' just because someone went nuts with boost.
 
although I think sorting the arrays is overcomplicating the solution. you're only being asked to display the lowest and highest values which you can do with a simple for.. loop, overwriting a variable like "highest_temp" each time a new highest is encountered. etc. for lowest (you could do this in the same loop even)

I'm not sure how to translate that into code? I'm sure an if/else statement would be involved but otherwise I've got nothing.
 

Blizzard

Banned
boost and the standard library (even in C++11) are orders of magnitude apart in terms of code size. Please don't 'avoid templates' just because someone went nuts with boost.
I avoid templates because I detest the syntax, the error messages, and so forth. If it's useful/simple/makes sense to me, I use them occasionally.
 
C-programming question again (since there is no C help thread).

At the bolded line I get the following error:
program12.c: In function ‘main’:
program12.c:28: warning: passing argument 1 of ‘maxminTemp’ from incompatible pointer type
program12.c:30: warning: passing argument 1 of ‘maxminPressure’ from incompatible pointer type

I can't make sense of the error message. I thought I got rid of the pointers?

Also, the program is the input temperature and pressure values into a multidimensional array, determine the extremes (min,max) for each (temp, pressure) and print both of them off. I don't think this program will run like I want it to, so I'd love to hear about any other errors you can spot.

Code:
#include <stdio.h>
#define ROWS 2
#define COLS 10

//Declarations
void input(float [][COLS]);
void maxminTemp(float [],float ,float);
void maxminPressure(float [],float ,float);
void funcoutput(float[]);

int main ()
{

float a[ROWS][COLS], b[ROWS][COLS], c[ROWS][COLS];
float results = 0;
int z = 0;
float max, min = 0;

//Input
input(a);

//Sorting
[B]maxminTemp(a, max, min);

maxminPressure(b, max, min);[/B]
//Output
/*funcoutput(b);*/

return 0;
}


//INPUT
void input(float arr[][COLS])
{
float value;
int i;

	for (i = 0; i < ROWS; i++)
	{
		printf("Enter temperature in Kelvins:\n");
		scanf("%lf", &value);
		arr[i][0] = value;

	
		int j;	
		for (j = 1; j < COLS; j++)
		{
			printf("Enter pressure in hectopascals:\n");
			scanf("%lf", &value);
			arr[i][j] = value;
		}

	}
}


//Sorting
void maxminTemp(float arr[],float amax ,float amin)
{
	int i = 0;
	for(i = 1; i < COLS ; i++)
	{
		if(arr[i] > amax)
		{
			amax = arr[i];	
		}
		else if(arr[i] < amin)
		{
			amin = arr[i];
		}

	}
	return;
}


void maxminPressure(float arr[],float bmax ,float bmin)
{
	int i = 0;
	for(i = 1; i < COLS ; i++)
	{
		if(arr[i] > bmax)
		{
			bmax = arr[i];	
		}
		else if(arr[i] < bmin)
		{
			bmin = arr[i];
		}

	}
	return;
}
//Output
 

dabig2

Member
C-programming question again (since there is no C help thread).

At the bolded line I get the following error:
program12.c: In function ‘main’:
program12.c:26: error: expected expression before ‘int’
program12.c:26: error: too few arguments to function ‘maxmin’

I can't make sense of the error message.

Also, the program is the input temperature and pressure values into a multidimensional array, determine the extremes (min,max) for each (temp, pressure) and print both of them off. I don't think this program will run like I want it to, so I'd love to hear about any other errors you can spot.

Code:
stuff

Any time you see that error message of "expected expression before...", it usually means your arguments for the function call are screwed up. And it most certainly is here. What you've done is basically redefine your function definition, when you should be passing in the arguments to it.

For instance, according to the declaration and the implementation, your first value into the maxmin function is some integer (your "count"). But you never actually create this integer anywhere in your program to pass to this function. Also, watch out for pointers. Your definition calls for 2 float pointers, so you need to make sure you pass in the addresses of your variables into the function.

For example, this line will compile:
Code:
int count = 10;
maxmin(count, array, &amax, &amin);

But your program will blow up soon after for various other reasons that I see. But it's more fun to discover that on your own (of course ask more questions if you can't figure it out).

Hint: you would not be the first student to have been confused by pointers and their relationship with arrays.
 
I editted my post with my new code. I haven't figured out the output function yet, but was hoping I'm on the right track for the rest of it?

Also, shouldn't the

Code:
void maxminTemp(float [],float ,float);
void maxminPressure(float [],float ,float);

functions be something other than void since I want to return the max/min elements in the array? Float? If that's the case, could someone refresh me on how I print to screen the figure the function returned back to the main ()?


Damn, I feel so dumb with this.
 

Blizzard

Banned
If you want to return multiple values, you would either make a struct that contains a collection of values and return that, or you would use pointers as the function arguments.

Code:
void someFunc(int* min, int* max)
{
   if(NULL != min)
   {
      *min = 42;
   }

   if(NULL != max)
   {
      *max = 93;
   }
}

void main()
{
int min, max;

someFunc(&min, &max);
}

Something like that. If you do not understand pointers, then you need to learn about that next. :)

*edit* Oh, and to print floats, use this:

printf("Float value: %f\n", whateverFloat);

Google "printf" or "man printf" if you need more details on printf.
 

Lathentar

Looking for Pants
If you want to return multiple values, you would either make a struct that contains a collection of values and return that, or you would use pointers as the function arguments.

Code:
void someFunc(int* min, int* max)
{
   if(NULL != min)
   {
      *min = 42;
   }

   if(NULL != max)
   {
      *max = 93;
   }
}

void main()
{
int min, max;

someFunc(&min, &max);
}

Something like that. If you do not understand pointers, then you need to learn about that next. :)
Or he could pass by reference and not need to do pointless NULL checks
 
I'm having a dickens of a time trying to convert an infix expression (a+b) into a postfix expression (ab+). I have a basic psuedocode algorithm but I just can't wrap my head around implementing it.

Any hints? I have a Stack class set up. I need to be able to pop the contents of the stack at varying time, but for some reason I'm having trouble.
 
I'm having a dickens of a time trying to convert an infix expression (a+b) into a postfix expression (ab+). I have a basic psuedocode algorithm but I just can't wrap my head around implementing it.

Any hints? I have a Stack class set up. I need to be able to pop the contents of the stack at varying time, but for some reason I'm having trouble.

A tree would make the most sense to me. For example, consider the expression a+b. In tree format this is represented as:

Code:
     +
   /   \
  a     b

The infix representation of this can be generated by doing a depth-first traversal, and, for each node, printing

1) open parentheses
2) left
3) self
4) right
5) close parentheses

The postfix representation can be generated by doing a depth-first traversal, and, for each node, printing

1) open parentheses
2) left
3) right
4) self
5) close parentheses


So basically, parse the expression, build up the tree, then do the secnod type of traversal. Here's an example of a more complicated expression:

(1 + 2 - ((3 + 4) * 5))

Code:
        +
      /   \
    1      -             {A}
          /  \
         2    *          {B}
             /  \
           +     5       {C}
          /  \
         3   4

Now, when you do the postfix traversal you get:

main:
* print(open paren)
* print(1)
* print({A})
* print(+)
* print(close paren)


print({A}):
* print(open paren)
* print(2)
* print({B})
* print(-)
* print(close paren)

print({B}):
* print(open paren)
* print({C})
* print(5)
* print(*)
* print(close paren)

print({C})
* print(open paren)
* print(3)
* print(4)
* print(+)
* print(close paren)

substituting back in, you get:

(1 (2 ((3 4 +) 5 *) -) +)

This evaluates to:

(1 (2 (7 5 *) -) +)
(1 (2 35 -) +)
(1 -33 +)
-32

which you can verify is the same as the original
 
My problem is, it's for a class, so the assignment is about dealing with stacks and linked lists. It doesn't have to be solved, I just have to convert the form from (a+b) to ab+. I have the algorithm mapped out on paper, but whenever I put it to code it doesn't want to behave.
 

jokkir

Member
Anyone know why I can't initialize these variables:

Code:
int size = strlen(data);
char tempData[size];

It gives me an error:
Code:
Error	1	error C2057: expected constant expression
Error	2	error C2466: cannot allocate an array of constant size 0	
Error	3	error C2133: 'tempData' : unknown size

I'm pretty sure im not violating anything but it just gives me that error. The 'data' string is a string from main() that contains commands and whatnot that I need to modify
 

Slavik81

Member
I believe that rule exists because variables allocated on the stack must have a size defined at compilation time. The size of your array depends on the length of the user's string, so the compiler doesn't know how much space to leave.

You'll probably want to dynamically allocate the array. If you're using C++, #include <vector> and try creating an std::vector<char> with that size instead.
 

gblues

Banned
I editted my post with my new code. I haven't figured out the output function yet, but was hoping I'm on the right track for the rest of it?

Also, shouldn't the

Code:
void maxminTemp(float [],float ,float);
void maxminPressure(float [],float ,float);

functions be something other than void since I want to return the max/min elements in the array? Float? If that's the case, could someone refresh me on how I print to screen the figure the function returned back to the main ()?


Damn, I feel so dumb with this.

Is this assignment supposed to be teaching you about array iteration, or about pointers? Because since your program only actually has to output the extremes of the data that was entered, you can avoid arrays entirely by using pointers. Or, you can use arrays to avoid using pointers. You should probably decide which you want to use, because right now it looks like you're trying to do both and (understandably) having problems.
 

Apoc29

Member
I believe that rule exists because variables allocated on the stack must have a size defined at compilation time. The size of your array depends on the length of the user's string, so the compiler doesn't know how much space to leave.

You'll probably want to dynamically allocate the array. If you're using C++, #include <vector> and try creating an std::vector<char> with that size instead.
If it really is 'temp' data as the identifier implies, you might as well just initialize it with a large number that will handle pretty much any sized string that might be used. This is common practice if you expect your string to not be more than a few hundred characters long. Anything significantly larger, you would probably do something like

char *tempData = new char[size];

A vector of chars seems kind of unorthodox, but I guess it depends on what you want to do with it.
 

jokkir

Member
I believe that rule exists because variables allocated on the stack must have a size defined at compilation time. The size of your array depends on the length of the user's string, so the compiler doesn't know how much space to leave.

You'll probably want to dynamically allocate the array. If you're using C++, #include <vector> and try creating an std::vector<char> with that size instead.

The size is set in main.cpp. The contents of data is:

Code:
char data[SIZE][61] = {
"go;north;south;east;west;start;left;right;home",
"look",
"pick up;gold;platinum;crystal;magic sword",
"drop;gold;platinum;crystal;magic sword",
"attack;crystal;magic sword"
};

Would vector still be necessary?
 

bluemax

Banned
I'm just curious, does anyone here use XCode? I'm working on a fairly large project that uses mostly C++ (with small amounts of Obj-C) and I'm finding XCode to be one of the shittiest IDEs I've ever used.
 

Apoc29

Member
The size is set in main.cpp. The contents of data is:

Code:
char data[SIZE][61] = {
"go;north;south;east;west;start;left;right;home",
"look",
"pick up;gold;platinum;crystal;magic sword",
"drop;gold;platinum;crystal;magic sword",
"attack;crystal;magic sword"
};

Would vector still be necessary?

Problem is the line 'int size = strlen(data);' is getting the size at runtime whereas the compiler needs to know the size of your array at compile time. You can do that with sizeof:

char tempData[sizeof(data)];
 

wolfmat

Confirmed Asshole
I'm just curious, does anyone here use XCode? I'm working on a fairly large project that uses mostly C++ (with small amounts of Obj-C) and I'm finding XCode to be one of the shittiest IDEs I've ever used.

I use Xcode. As long as all I'm doing is coding and jumping through the tree of files, it's alright. Anything beyond that is a hassle.

I would say it's gotten notably worse in the last years. Debugging got sort of insane, for instance.
 

maharg

idspispopd
Yeah, xcode is an incredibly crappy IDE for C++. It used to be ok when it was basically just a retread of CodeWarrior, but at some point it just went wonky and never recovered.

If you're not doing something explicitly OSX related, I recommend taking a look at qtcreator. It's actually quite usable for things that aren't Qt-based and it's quite reminiscent of Visual Studio when it didn't suck so much.

Or for something more lightweight, you can now get clang and gdb integrations for Sublime Text 2 that make it a pretty damn competent C++ editor.
 

Slavik81

Member
I think I love VAX too much to switch away from Visual Studio, even if I'm sitting here on 2008. It's really the only reason I don't use QtCreator.

Though, Microsoft's plodding development of C++11 features almost makes me want to switch to MinGW.
 

bluemax

Banned
Yeah, xcode is an incredibly crappy IDE for C++. It used to be ok when it was basically just a retread of CodeWarrior, but at some point it just went wonky and never recovered.

If you're not doing something explicitly OSX related, I recommend taking a look at qtcreator. It's actually quite usable for things that aren't Qt-based and it's quite reminiscent of Visual Studio when it didn't suck so much.

Or for something more lightweight, you can now get clang and gdb integrations for Sublime Text 2 that make it a pretty damn competent C++ editor.

Well I'm porting a game from DirectX to iPhone/iPad using primarily OpenGL. There is very little Objective C in the app right now, mostly just wrappers for file IO.

But yeah, XCode routinely shits the bed for me. Example, I modify a Luascript file. XCode will not attach the debugger after I compile and run, and I'll have to force quit it. Then when it starts again it will have to recompile my entire project for no apparent reason.

I lose at least 30 minutes a day restarting XCode or waiting for it to recompile my entire project when I only changed one file that wasn't a header.
 

maharg

idspispopd
I think I love VAX too much to switch away from Visual Studio, even if I'm sitting here on 2008. It's really the only reason I don't use QtCreator.

Though, Microsoft's plodding development of C++11 features almost makes me want to switch to MinGW.

I never used VAX back when I used VS, it wasn't quite the ultrapopular behemoth it is today, but a lot of people I know who are huge fans of it have become enamoured with ST2+SublimeClang, which does a lot of similar things afaik.
 
Yeah, xcode is an incredibly crappy IDE for C++. It used to be ok when it was basically just a retread of CodeWarrior, but at some point it just went wonky and never recovered.
Was Xcode ever really a retread of CodeWarrior? I was under the impression Xcode had its roots in Project Builder, which came from the NeXTStep/OpenStep side of OS X, while CodeWarrior was always on the Classic Mac side, where it competed with MPW.
 

maharg

idspispopd
Was Xcode ever really a retread of CodeWarrior? I was under the impression Xcode had its roots in Project Builder, which came from the NeXTStep/OpenStep side of OS X, while CodeWarrior was always on the Classic Mac side, where it competed with MPW.

In the early OSX days I saw a lot of similarities. I never managed to use NeXT, personally, so I have no idea what Project Builder was like or what kind of cross-pollination there might have been back then.
 

hitsugi

Member
We should do a post your IDE round or something.. I've always liked VS because it's what I started on in school and has the widest selection of style options (at least, outside of vim/emacs). Its been hard for me to find ir_black for anything else, and I love those colors.
 
Yeah, xcode is an incredibly crappy IDE for C++. It used to be ok when it was basically just a retread of CodeWarrior, but at some point it just went wonky and never recovered.

If you're not doing something explicitly OSX related, I recommend taking a look at qtcreator. It's actually quite usable for things that aren't Qt-based and it's quite reminiscent of Visual Studio when it didn't suck so much.

Or for something more lightweight, you can now get clang and gdb integrations for Sublime Text 2 that make it a pretty damn competent C++ editor.

VS has gone backwards in some ways, but forward in many others. I still think its the most efficient in terms of GSD and has the largest fearure set overall, although some things seem to get worse before they get better.

I thought Xcode was supposed to be better now in in iteration 4? Its not?

The biggest reason i always go back to visual studio is because the debugger blows everything else away. If only they would fix/improve autoexp.dat it would be almost perfect
 

maharg

idspispopd
VS has gone backwards in some ways, but forward in many others. I still think its the most efficient in terms of GSD and has the largest fearure set overall, although some things seem to get worse before they get better.

I thought Xcode was supposed to be better now in in iteration 4? Its not?

The biggest reason i always go back to visual studio is because the debugger blows everything else away. If only they would fix/improve autoexp.dat it would be almost perfect

I think the only thing xcode is any good at at this point is maybe ObjC iPhone/OSX app development. And I only take that on faith since it's not what I do.
 

Lumination

'enry 'ollins
Hey all, I couldn't find a better thread to ask this in, so I'll give it a shot here.

I was wondering if anyone knew of any good resources to study algorithm/database problems for an entry-level software engineer position. I have some interviews lined up later in the month, and I want to brush up on my stuff. Language is not important, but the focus would probably be on Java, Python, and C/C++.

Thanks!
 

wolfmat

Confirmed Asshole
I think the only thing xcode is any good at at this point is maybe ObjC iPhone/OSX app development. And I only take that on faith since it's not what I do.

It's good with code generation based on UI design. And it has a strong dynamic analysis suite called Instruments. Most of the time though, I find that stuff Apple likes to call the key features stands in my way. Like the way you check values of variables while debugging with mouse-over, wtf.
 

Kalnos

Banned
I was wondering if anyone knew of any good resources to study algorithm/database problems for an entry-level software engineer position. I have some interviews lined up later in the month, and I want to brush up on my stuff. Language is not important, but the focus would probably be on Java, Python, and C/C++.

Well, if it's databases then those languages would probably be used mostly for front-end things, yeah? If I was guessing I would say it would probably be wise to read up on SQL if that's the case; W3Schools is a decent place to brush up.

'Algorithms' is a pretty broad subject... maybe just brush up on some of the basic important ones like sorting? It's pretty easy to find popular interview questions for the CS field by Googling honestly and it's good practice to boot!
 
For algorithms questions, I hate to say it, but read about about programming interview questions. It's the best bang for your buck in terms of actually being prepared for what they might ask.
 
Status
Not open for further replies.
Top Bottom