381 Posted Topics
Re: I do cheat, but only the subject I don't like. | |
Re: [code] #include<stdio.h> #include<conio.h> [/code] Omit these header files because they are C header files. C++ use [I]#include <iostream>[/I] [code] double result[COLOR="Red"];[/COLOR] [/code] Make sure every statement is end with semi-color( ; ). [code] cout << "\n Enter in order x1,x2,y1,y2: "; cin>>x1>x2>>y1>>y2>>\n; [/code] To gain access to use [I]cout [/I]and … | |
Re: It doesn't work with Code::Blocks. I think it works only in the old version of C compiler such as Turbo C. | |
Re: frmsummary.lblfname0[COLOR="Red"].Caption [/COLOR]= frmWage.lblfirstname.Caption | |
Re: Provide us some piece of code which you think it is where the error is occured, and explain your purpose. | |
Re: [code=cplusplus] int k=0, i=0, c=0; while (k < SIZE) { c++; if (mat[k][i] == 1) { k++; i = 0; continue; } if (i == SIZE-1) break; i++; } [/code] Is this a Big O(n)? | |
Re: 407.... on my first attemp, I am going to give another try. | |
| |
Re: [QUOTE=Salem;498394]> Say every 5 miliseconds. Does your monitor refresh at 200Hz ? If there is no way for you to observe the effects of such a high resolution event, then what would be the point of trying it? Besides, once you get below the normal scheduling frequency of the OS … | |
Re: When coding graphic game, there are two things you should know: the non-graphic part and graphic part. Non-graphic part is the bunch of variables that work in the program; Graphic part is to translate from those variables into visable graphic. Anothing thing you should know if FPS(frames per second). For … | |
Re: Why make your code so complicated? The most basic concept of finding prime is to test from[I] 2[/I] until [I]number-1[/I]. Once you find the divisor number of that number, then you are also able to find the factor of that number. [code=cplusplus] int factor1, factor2; bool prime = true; for(int … | |
Re: [QUOTE=dubeyprateek;497579]There is no way (at least in C and C++) you can input a mathematical expression in the form of mathematical expression. You can only input a string and convert it to mathematical expression and [B]do the calculation[/B].[/QUOTE] No easy to do that. | |
Re: [B]The list of all functions in <unistd.h>[/B] [code] int access(const char *, int); unsigned int alarm(unsigned int); int brk(void *); int chdir(const char *); int chroot(const char *); (LEGACY) int chown(const char *, uid_t, gid_t); int close(int); size_t confstr(int, char *, size_t); char *crypt(const char *, const char *); char … | |
Re: I don't understand your problem. You should describe little more detail. | |
Re: I am not sure because I haven't program in VB6 for so long. I think Form.Visible would be the answer because if Form.Visible = false which mean the form doesn't not appear in the screen. | |
Re: More comments are needed to be added. [code=cplusplus] /********************************* * What is the title of your program? * * What is the purpose of this program?* * Written by who? * *********************************/ // What is this union for? union element { char sym; // what is this char for? int … | |
Re: [code] #include<iostream> float celsius_to_fahrenheit(float); int main() { float fahrenheit; float celsius=22.5; fahrenheit=celsius_to_fahrenheit(celsius); [COLOR="Red"]std::[/COLOR]cout<<celsius<<"C="<<fahrenheit<<"F\n"; return 0; } [COLOR="Red"]float[/COLOR] celsius_to_fahrenheit(float celsius) { return(celsius*(9.0/5.0)+32.0); } [/code] | |
| |
Re: Another solution: [code=cplusplus] #include <iostream> using namespace std; int main() { int x, y; while (true) { cout << "Please Enter a positive number\n"; cin >> x; if(0 != x || 1 != x) break; cout<<"Please try again with number other then 0 or 1\n"; } for (y = 2; … | |
Re: [code] int [COLOR="Red"],[/COLOR]x,y; [/code] Delete the comma. [code] strFreq.MakeUpper(); strHL.MakeUpper(); if(strFreq=="x" && strHL=="y") [/code] You made those strings into upper-case and then you compare it with lower-case string. | |
Re: "My dog had passed away, and I attended his funeral yesterday" | |
Re: [QUOTE=hellokitty88;494492]I am reading a text file from an input file. The problem is that when I cout the text to the screen not all of the original text file is showing. The text file is large, but I was wondering if there was any way I could possibly display all … | |
Re: Well, your assignment is already well-described. It's already told you what structure and functions you need. | |
Firstly, I got this class: [code=cplusplus] class A{ public: void show() { std::cout << "Hello World"; } } a; [/code] I am trying to get the address of [B]show()[/B] function. [code=cplusplus] int main() { void (*ptr)(); ptr = &a.show; *ptr(); return 0; } [/code] And, it doesn't seem to work … | |
Re: [code] if (answer == 2) {cout<<"\nThe perimeter is:" << perim << "meters\n";} [COLOR="Red"]{[/COLOR] else if (answer > 2) {cout"\nInvalid command!\n";} [COLOR="Red"]}[/COLOR] [/code] Unexpected open and close brace. | |
Re: [I]Number1 % Number2 == Reminder[/I] which the reminder is always in the range of 0 to (Number2 - 1) | |
Re: The [B]isspace(int ch) [/B]function returns nonzero if [I]ch[/I] is a whitespace character, including space, horizontal tab, vertical tab, formfeed, carriage return, or newline character; otherwise, zero is returned. | |
Re: [16:08] <Josh> tan(90 degrees) isn't infinity, right? [16:08] <Josh> it's undefined :) [16:08] <Josh> ya [16:08] <sarehu> 90 degrees is not in the domain of the tangent function [16:08] <Josh> exactly [16:08] <sarehu> but lim (x->pi/2) (tan(x)) does not exist [16:09] <sarehu> since on one side, it tends towards +infinity, … | |
Re: I don't know what is your question. However, I found you have a small mistake in line 27. [code] ptrFileIn= fopen([COLOR="Red"][B]"data1"[/B][/COLOR],"r"); [/code] I think it suppose to be [code] ptrFileIn= fopen([COLOR="Green"][B]data1[/B][/COLOR],"r"); [/code] | |
Re: Please make your code readable by using <code=cpp>your code</code>. Change from < to [ and > to ] | |
Re: You can using qsort() function which is come with <stdlib.h> header. Here the example of how to use this function: [code=cplusplus] #include <stdio.h> #include <stdlib.h> int CompareFunction(const void *p1, const void *p2) { if (*(const int*)p1 > *(const int*)p2) return 1; else return -1; return 0; } int main() { … ![]() | |
Re: I don't really understand. Here it is what I am understand so far: + First, we need to generate 4 random letters word. + Player can only guess one letter for 8 times. For example: (computer generate this letter [b]hstd[/b]) Guess this word **** Input your letter: [COLOR="Red"]o[/COLOR] There is … | |
Re: [code] for( int i=0; i< [COLOR="Red"][b]14[/b][/COLOR]; i++) { p[i]= (200+.09*sales[i]); } [COLOR="Red"][b]printf("%7d%13d ", i, sales[i]);[/b][/COLOR] [/code] 1) You have 20 data of salaries. However you only loop 14 times. 2) I think you mistakenly [B]printf[/B] outside your loop. [code] [B][COLOR="Red"]int range[SIZE]={0};[/COLOR][/B] [/code] 3) You seem to declare a variable that … | |
Re: [code] [COLOR="Red"]int *pointer [10];[/COLOR] struct cell{ int death; }; int test() {cout << pointer[0] -> death;} int main () { cell test; [COLOR="Red"]cell * pointer[0];[/COLOR] pointer[0] = &test; pointer[0] -> death = 5; test() cin.get(); return 0; } [/code] You've declared [B]pointer[/B] twice. | |
Re: I haven't played around with OpenGL for long time, but I know the place what I think it is able to help you [url]http://nehe.gamedev.net/[/url] | |
[code=cplusplus] int i ; n = 20 ; for ( i = 0 ; i < n ; i--) printf('x'); [/code] Find 3 ways to make this code print [b]x[/b] 20 times by ONLY CHANGE ONE CHARACTER in this code. Have fun guy! | |
Re: [code=cplusplus] int main() { // code here } [/code] [B]int main()[/B] is standard while [B]void main()[/B] is not standard. It is good habit to use int [B]main() [/B]instead of [B]void main()[/B]. | |
Re: If I were you, I would shorten to this: [code] #include <iostream> int main() { for(int i=1; i<=5; i++) { for(int j=i; j<=5; j++) std::cout << j << ' '; std::cout << std::endl; } return 0; } [/code] | |
Re: In my opinion, you should create $_SESSION['attempt'] and make it expire every 5 minutes. Everytimes user fail to login, $_SESSION[attempt] will increase by 1 if user attempt more than 5 times then disable login page. This is what I think it should be. | |
How can I know if my website is in top1000 in google with one speciafic keywork. For example: "computer".... | |
Anyone know how to get HTML code from the URL in php? | |
Re: Last night, I encounter this script maybe it is what you want. [url]http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=606&lngWId=8[/url] | |
How can I use variable from the outside of the class? For example: [code] <?php $outside = 'Hello'; class A { function printme() { print $outside; } } $cls = new A(); $cls->printme(); ?> [/code] How can I do it? please :D | |
It is my first time in here and also my first question. I hate to admit it that I got stuck now. I got the Apache set up on my new computer and also the PHP5. After that, I modified the Apache2 httpd.conf file. [i]I added this into my configure … ![]() | |
Re: you can use Shell Function [i]Syntax : Shell(PathName, [WindowStyle])[/i] example : [code] Private Sub Form_Load() Shell ("notepad") End Sub [/code] | |
Re: Linkin Park Papa Roach Limp Bizkit Green Day ("Boulevard Of Broken Dreams") Oasis Gorillaz SR-71 ("Tomorrow") P.O.D | |
It may offer a functional distribution of Linux, but the Linux kit for PlayStation 2 is also very much about making PlayStation 2 hardware accessible for learning how to develop games, and in the past year that the Linux kit has been available, we are pleased to say that several … | |
Microsoft have no long support VB6 anymore. and How about ASP3 ? |
The End.