- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
44 Posted Topics
1. I see %f is for float, %@ is for string. Is %d for anything? Which % is for double? Which % is for BOOL? 2. What is the different between double and float? When I put float flow=-8.1234567890123456789; //4 bytes floating point double dobble=-8.1234567890123456789; //8 bytes floating point NSLog(@"flow …
How do I find the length of an NSMutableArray?
This code gives me the error message "warning: passing argument 1 of 'stringWithCString:encoding:' makes pointer from integer without a cast" #import <Cocoa/Cocoa.h> #import <Foundation/NSObject.h> #import <stdio.h> //#import <string.h> @interface Numbers : NSObject { NSString *name; int age; NSMutableArray *list; } //-(void) setName; -(void) setAge :(int)a; @end @implementation Numbers -(void) setName{ …
Hello, I have learned some basic Java, but now I want to learn Objective-C. Is there a tutorial or problem set of programs to make that I can follow to quickly learn the basics? Here is what I know how to do so far... #import <Foundation/Foundation.h> int main (int argc, …
I am not sure I know enough to really understand your code. I am trying to learn Objective-C. One thing I noticed is common is that in the creation of a class, it is done in a header file like so... FILE 1 | class.h | declares the class, the …
I heard that Code::Blocks is a good free compiler.
I recently installed a 2nd HDD in my optical drive space using an optibay imitator. Basically, there is a PATA to SATA converter so that I have an HDD instead of a disk drive. It is a late 2006 MacBook white. Everything worked great except for one minor glitch. When …
Hi! Sorry if this is the wrong forum to post this on but... I had a Leopard computer with all developer tools installed. Then I upgraded to Snow Leopard (erase and install), and restored from time machine. I tried the gcc command only to get "gcc: command not found". The …
I have Snow Leopard. I installed rEFIt via the package. Then I installed Ubuntu via this guide (dual boot): https://help.ubuntu.com/community/MactelSupportTeam/AppleIntelInstallation Afterwards everything worked, and I could even boot Ubuntu without using rEFIt. I decided to uninstall rEFIt since I had no need for it. So I followed the instructions here …
In "push_back()" you are supposed to input the value which you are adding to the vector. For example, v.push_back("hello") Perhaps you were under the impression that the value you put in push_back is the number of new slots being created. I believe your code should look like this: [CODE]for (int …
Hello, I am looking for a good library to manipulate matrices. The criteria is as follows... 1. It must have a large amount of functions that we may need to use in the future. Functions will include but are NOT limited to: --sortbyc( Mat, col) (sorts rows in a matrix …
[CODE] while(y<=num) { x= x + y; y= y + x; cout<<" "<<x<<" "<<y; }[/CODE] let's say you don't want y to be bigger than 34. Let's say num=34 and y=33. Look at the above code. It sees that y<=num, and runs what is inside the brackets. Inside the brackets, …
it looks like ztdep has done it. please mark the thread as solved when your problem is solved ;)
1. In a for or while loop, if the condition is breached in the middle of the brackets {}, will the code immediately stop the loop, or wait until it gets to the bottom of the brackets {} ? 2. If a function is called in my code, does the …
when I... [CODE]double a = 0.00000001; cout<< a <<endl;[/CODE] The computer outputs 1e-07. I want to force the computer to write it as 0.00000001 thanks! ;)
you can download DevTools from the apple website to get the SDK. try looking here: [url]http://developer.apple.com/devcenter/ios/index.action[/url] at the bottom it says "iOS 5 beta and Xcode 4.2 with iOS 5 SDK beta" you need to create an account which is free
This code compiles but refuses to run. NONE of the cout statements appear, as if the program is in an infinite loop except that its not. [CODE]#include "matrixOpsLibrary.h" #include <iostream> using namespace MattsMatrixSpace; using std::cout; using std::endl; Mat pattern( unsigned K ){ cout<<"5"; Mat alpha; //this becomes our A variable …
error: ‘void __stderrp(MattsMatrixSpace::Vec)’ redeclared as different kind of symbol I have a function called "stderr" in my program. I'm not sure where the "__" or the "p" came from. Any idea what this error is related to? PS, the next error is: /usr/include/stdio.h:169: error: previous declaration of ‘FILE* __stderrp’
What is the easiest way to check if a vector is empty? [CODE]#include <iostream> #include <vector> using namespace std; typedef std::vector<double> Vec; typedef std::vector<Vec> Mat; int main(){ Vec v; // this is what i consider to be an "empty" v if( /*check if v is empty here*/ ) cout<< "v …
you must post up your code so that we can reproduce the error. Otherwise we cannot help you. :)
This function is returning the error "matrixOpsLibrary.h:11: error: invalid initialization of reference of type ‘const std::Vec&’ from expression of type ‘const double’" [CODE]#include <vector> #include <cmath> using namespace std; typedef std::vector<double> Vec; //Vector Vec floor( const Vec& y ){ unsigned n = y.size(); Vec bottom(n); for( unsigned e=0; e<n; ++e …
What happens when you set an int or double value to less than the minimum? I need my program to recognize when a number is smaller then the minimum, and then set the value to equal the minimum instead. This behavior is not the default... [CODE]#include <iostream> using namespace std; …
I want two function names that do the same thing, allowing the user to use whichever they prefer. For Vec a, i use "const" because a is never changed. Correct me if this is the wrong usage. For int n in operator|, i do NOT use "const" because n is …
I suggest posting up the full code of some of the ways you tried using LoadString along with the specific error you get for each. ;)
I was advised that I should not import the std namespace in a header. Also, I should create my own namespace for my library (a header file I created with function in it). Why is it a bad idea to use the std namespace for my new functions? If all …
There is an error concerning lines 10-14. I had been using this code previously without errors. I'm not sure what I may have changed. The error is "invertMatrix.cpp:14: error: invalid use of incomplete type ‘struct std::stringstream’ /usr/include/c++/4.2.1/iosfwd:83: error: declaration of ‘struct std::stringstream’ " [CODE]#include <iostream> #include <vector> #include <cmath> using …
I am building a library of matrix and vector operations. As my library has grown bigger, I have found that there are MANY by element operations which I need to program. For example, if the user wants to multiply each element in the matrix by 2, or if the user …
What is the difference between "int main(void)" and simply "int main()"? Is "int main()" acceptable?
Do you want the high score to be recorded only while the program is running, or forever? If you want it only while the program is running, you can create variables called "int highscoreNumber;" and "int highscoreAlphabet;" at the beginning of your int main(). Then, in your case 4, you …
[CODE] system("pause"); return 0; } [/CODE] Also, the experts suggest: "Don't use system("pause") to pause your program if possible. Use getchar( ) if you are using C and cin.get( ) if you are using C++." This tip found here: [url]http://www.daniweb.com/software-development/cpp/threads/67837[/url] :)
x.find() does not return the proper values for x.find('J'), x.find('K'), and x.find('.'). Do you know what could be the issue? It could possibly be x.substr() which is causing the issue. I want the variable q to be "q_J30_K5.txt". [CODE] #include <iostream> using namespace std; short ato( string number ){ return …
[CODE]int operator%( double a, double b ){ int aa = (int) a; int bb = (int) b; return aa%bb; }[/CODE] gives me an error message "must have an argument of class or enumerated type"! As you can see, I want a simple program which truncates doubles into their equivalent integers, …
Is your assignment to actually find the moves to switch the tower, or simply to find the NUMBER or moves necessary? If you only need the NUMBER of moves, then you should be able to derive a formula for it, and no programming is really necessary. If you need to …
If you are using a mac, I suggest downloading the free Developer package and then compiling the code in the Terminal. The Developer package includes other compilers that you might be interested in, such as Perl.
I suggest posting up the error messages on the forum. They will tell us exactly what is wrong with your program. If there are a LOT, then just post the first few. Also, I suggest writing a simpler program. This will allow you to pinpoint errors before writing something so …
This program refuses to take foom as input, yet if I were to put "matrix.txt" into the function instead of foom, it would work fine. [CODE]#include <fstream> #include <iterator> #include <sstream> #include <vector> #include <string> // needed? using namespace std; typedef vector<double> Vec; typedef vector<Vec> Mat; Mat readMatrix(string foom){ Mat …
At the beginning of your "main (void)" function, I see "{ int num1, num2, num3, float num4, int calc1, int calc2, int calc3, int calc4, double calc5, double calc6, float calc7, float calc8);" Notice that it ends with a ")", but there is no "(" before it. That must be …
I have a Plain Text matrix file (called q.txt): [CODE]1 0 0 0 2 0 0 1 1 0 0 1 1 1 1[/CODE] which I would like to read into a matrix, which is a vector containing vectors (which contain doubles). My current codes yields the error "newReader.cpp:22: error: …
Hi! I am looking for a solution to use the onKeyPress() event in Safari or Chrome. It seems very tricky, because each browser behaves differently. This is what I have so far... [CODE]... <script type = 'text/javascript'> function turn(e){ alert('turn!'); } </script> <body onKeyPress='turn(event)'> </body> ...[/CODE] I also want to …
Here is a simple program which gives me unexpected results: [code=c]int main() { printf("\nTo calculate a^b, enter value a now.\n"); int a = getchar() - '0'; printf("\nEnter b now.\n"); int b = getchar() - '0'; printf("a = %d, b = %d\n\n", a, b); return 0; }[/code] if i hit a …
please note some small syntax changes i have made to your code. although they seem like a burden, this sort of correctness and neatness will make the code clearer and easier to understand. best of luck! ;) [code=c]#include <stdio.h> #include <ctype.h> int main() { int c, nletters[26], i; for (i …
what is a divided difference table? what are p1(x), p2(x), etc...? I would love to help you out, but you need to give us more details. Please explain it clearly.
in fact, [CODE]printf("15%!"); //prints 15![/CODE] (note small syntax error above) ;)
I have just begun to learn HTML about a month ago. My objective is to create a site that any visiter may post onto. (Kinda like the site you are on now just a lot simpler). In other words, the person would type stuff in a box, and press submit. …
The End.
MareoRaft