- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
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, … | |
Re:
I was going to post this in a thread, but it turned into something a bit more serious and may be useful as a code snippet. The code shows three files: * menu.h: The header file for the menu library. * menu.c: Implementation of the menu library functions. * main.c: … | |
Re:
I think this community member will help me to clear my problem. Am not a c++ professional just a beginner. Am on the way to create a software for a browsing center. Am almost struck with the problem of creating multiple text files. To be more clear, Say, a browsing … | |
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 … | |
Re:
Hi i'm making a function that will return make a series of strings and perform a function returning a value for each. I've stored the strings in one vector v, and the integer values in another v2. Then it is supposed to return the string that corresponds to the smallest … | |
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 … | |
Re:
The problem is this. I try to enter the limit of at least 34 fibonacci numbers but the limit display the limit of 89. [CODE]#include <iostream> using namespace std; int main() { int x=0,y=1; int num; cout<<"Enter number:"; cin>>num; cout<<x<<" "<<y; while(y<=num) { x= x + y; y= y + … | |
Re:
sample output... ex.1 enter a number: 5 ***** ***** ***** ***** ***** ex2. enter a number: 2 ** ** | |
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! ;) | |
Re:
Hi! All.. It is asked that Can a C++ programme be converted to an i-phone app?, by means of any converter or something like that. | |
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 … | |
Re:
hello i just have started learning c++ but i have a big problem at sources .. i want to make something is unsigned then i have to change it from int3t_t to unit64_t but when i change it at player.h it says it must be changed at creature.cpp and alot … | |
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 … | |
Re:
I am trying to use CString's LoadString function but it never retrieves the text from the string table. I ported the application from Visual Studio 6 to visual studio 2003. I looked all over the web but nothing is working. Somebody help me! And if you could be very specific. … | |
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? | |
Re:
[CODE]// Randam Guessing Game #include <iostream> #define NEWLINE "\n\n\n" #include <cstdlib> // need to use rand() function #include <ctime> using namespace std; /*void Start(); void GetResult(); void HighScore(); int a, b, chance, maxrand; char difficultychoice, menuchoice, diffchoice; void Start() { a = 0; b = 0; chance = 0; maxrand … | |
Re:
Hi there guys I need some help I am creating an inventory with loads of exception handlers, I got a problem with isalpha and isdigit because supposedly it will detect whether an input is a char or a digit... Ok I tested a simple program to show my problem. I … |