233 Posted Topics
Re: Use static before __declspec...first lib.!... | |
![]() | Re: [code=c] #include <stdio.h> int main() { int toonie, dollar, quarter, dime, nickel, cent; float amount, change, cchange; char ch='Y', N, Y; while(ch=='Y'){ //-- init / reinit toonie = 0; dollar = 0; quarter = 0; dime = 0; nickel = 0; cent = 0; printf("\n Your total is $", amount); … |
Re: #include <iostream> #include <iomanip> #include <cmath> #include <string> using namespace std; // Declaring prototypes void displayWelcome(); double correctCost(double); double getMarkUp(string); void calculateRetailPrice(int, double, double, double &, double &, double &); void displayResults(string, int, double, double, double, double, double); int main () { // Declaring variables int quantity = 0; double … | |
Re: [code=c++] int random (int num) { srand (time (NULL)); num = rand(); cout << num << endl; if (num != 0) return random(num % 10); num = num / 10; } [/code] | |
Re: [code=c] //... flush(stdin); operation = (bit)(getchar() == (int)'+'); //... [/code] | |
Re: Sedikit informasi... Semoga dapat membantu [code=c++] #ifndef _MSC_VER #include <string.h> #else #include <string> #endif //..... [/code] | |
Re: [code=c++] //-------------------------------------- int A[2][2]={1,2,3,4}; //--overflow func(A); //-------------------------------------- int A[1][4]; A[0][0] = 1; A[0][1] = 2; A[0][3] = 3; A[0][4] = 4; //-------------------------------------- [/code] | |
Re: 1. nop.. (char) max size = 16 bit (int) max size = 32 bit (__intn) max size = 8,16,32,64 bit (float) max size = 32 bit 2. use static for global variable or global function [code=c] static int a = 10; static void do_something(void); [/code] | |
Re: [code=c++] //.... if(isspace(input[charPosition])) //--or input[charPosition] == char(/*decimal number for space*/) && input[charPosition] <= '@') { intVal = input[charPosition] + 0; character = char(intVal); finalText = finalText + character; } //.... [/code] | |
Re: [code=c++] //...maybe this impl. can help [DllImport("./MXFWrapperMarvel.dll", EntryPoint = "add")] static extern int APIENTRY add(int a, int b); //... [/code] | |
Re: [code=c++] int main () { double num = 0.0, sum = 0.0, average=0.0; cout << "Enter a value -99 to end:"; cin >> num; while (num != -99) { sum = sum + num; average = sum/num; cout << "The average is:" << setprecision (2) << (double)average << endl << … | |
Re: [code=c++] #define NULL 0 .... while((tmp&0xc0) != NULL) { printf("11xx-xxxx bits of chr[%d]=%x\n",i,tmp&0xc0); //extract 1100 0000 tmp = tmp<<2; } [/code] | |
Re: [code=c++] void initialize (ifstream& soda, ifstream& coin, SodaMachine* soda_machine) { string coin_line; char coin_type; char temp_char; int num_coins; //do //{ //Read in line from file coin >> coin_type; //Check to make sure coin_type is a valid type switch (coin_type) { case 'Q': coin_type = 'q';// remove this if you don't … | |
Re: your code : [code=c++] dynamicarray = new char(Size([20]); [/code] my code : [code=c++] ... dynamicarray = new char(Size([20])); // <-- ??? //--or dynamicarray = new char(Size(20)); //--or dynamicarray = new char[20]; [/code] | |
Re: maybe this can help...vote me... [code =C++] // constructor Employee::Employee( int eID) : setEmployeeID( eID ) { // :-) } [/code] | |
Re: [code=cplusplus] #include <iostream> #include <conio> using namespace std; //Function prototype void getscore(int, int, int, int, int); int main() { int score1, score2, score3, score4, score5; //===== for (unsigned int i=0;i<5;i++) { cout << "Enter your five test scores: "; if (i==0) cin >> score1; // cin >> score[i]; else if … | |
Re: [code] // call : system("pause"); // || system(pause); // maybe.. [/code] | |
Re: remove the stars at line : 107 125 etc... | |
Re: remove: static int16_t buffer_out[buf_size]; change into: int16_t buffer_out[buf_size]; .......he..he | |
Re: //example : ........... class quizz { private: string question1; // .......... public: quizz() { question1 = "what is the net"; } void outA() { std::cout<<question1 <<std::endl; } // ............... }; // you can try it.. | |
Re: Change the private constructor into a public constructor.. .....??? |