Forum: C Jan 7th, 2009 |
| Replies: 10 Views: 746 #include<stdio.h>
#include<conio.h>
int main(void)
{
int row=0,col=0,sp=0,b,mid=1,st=71,end=64;
//clrscr();
int column_num=0;
for (row=1;row<=7;row++)
{ |
Forum: C++ May 9th, 2008 |
| Replies: 3 Views: 450 I see that the problem is little but the code is huge and unrecognisable.... |
Forum: C++ May 9th, 2008 |
| Replies: 3 Views: 865 Maybe Lenght+1? What compiler system do you use? |
Forum: C++ Apr 11th, 2008 |
| Replies: 6 Views: 2,700 |
Forum: C++ Mar 7th, 2008 |
| Replies: 2 Views: 472 I think that you should try to put template<class TYPE> before EVERY function which is uses TYPE.
KTYPE analogical. |
Forum: C++ Mar 6th, 2008 |
| Replies: 1 Views: 1,160 Have an idea that you have not included headers. Maybe you typed class name incorrectly. |
Forum: C Mar 4th, 2008 |
| Replies: 2 Views: 710 No capital letter in void:
void powerArgs(int *parmA, int *parmB)
{
int temp = *parmA;
*parmA = *parmB;
*parmB = temp;
} |
Forum: C++ Mar 4th, 2008 |
| Replies: 1 Views: 416 Maybe you should set a type to parmA & parmB:
void divideArgs(int *parmA, int *parmB){
int temp = *parmA;
*parmA = *parmB;
*parmB = temp;
} |
Forum: C++ Mar 4th, 2008 |
| Replies: 5 Views: 2,584 |
Forum: C++ Mar 4th, 2008 |
| Replies: 1 Views: 2,128 int *temp = *parmA;
*parmA = *parmB;
*parmB = temp;
Forget pointer with temp. |
Forum: C++ Mar 4th, 2008 |
| Replies: 5 Views: 2,584 Definition:
BOOL SetFileAttributes(LPCTSTR lpFileName, DWORD dwFileAttributes);
dwFileAttributes can take these parametres:
FILE_ATTRIBUTE_ARCHIVE
FILE_ATTRIBUTE_COMPRESSED... |
Forum: C++ Mar 3rd, 2008 |
| Replies: 10 Views: 837 What is oyur OS and compiler? |
Forum: C++ Mar 3rd, 2008 |
| Replies: 10 Views: 837 |
Forum: C Mar 3rd, 2008 |
| Replies: 2 Views: 495 Try:
for (x = integer1;integer1 < integer2;integer1++);
{
sum += integer1;
}
You should add numbers to sum, so take a sheet of papper and look what you are doing. |
Forum: C Feb 27th, 2008 |
| Replies: 8 Views: 1,466 You should anything about how to wrogramming matrixes. WaltP is right, we don't write programmes for nothing. |
Forum: C Feb 27th, 2008 |
| Replies: 7 Views: 572 Post what you have done. Do you even know how to write programmes? |
Forum: C Feb 27th, 2008 |
| Replies: 4 Views: 730 Look for this
Individual **temp_;
temp_=(Individual **)malloc(sizeof(Individual)*5);
malloc return a pointer, not double pointer. So you must do memmory allocation in the loop. Better to... |
Forum: C++ Feb 27th, 2008 |
| Replies: 4 Views: 1,184 #include "stub.h"
int main()
{
int x;
int sum = 0;
int num1=1;//Just init previous 3 numbers
int num2=2;
int num3=3;
do |
Forum: C Feb 27th, 2008 |
| Replies: 2 Views: 648 Here is a simple one. I can't write without classes, anyway.
#include <iostream>
struct listelem {
char data;//any type here
listelem* next;
}; |
Forum: C Feb 27th, 2008 |
| Replies: 2 Views: 511 You are posting your code twice. With wich I should work?(interesting) |
Forum: C Feb 27th, 2008 |
| Replies: 3 Views: 885 There are a lot of syntax errors in your code. You forget to put ' ; '. case77 is not correct to. Maybe ou want case 77 (with space).
The last is that you use goto and it is very bad style so I... |
Forum: C++ Feb 26th, 2008 |
| Replies: 8 Views: 1,783 Really it is doing with int 21h in MS-DOS. I don't know how right now but if you want I'll review asap. |
Forum: C++ Feb 21st, 2008 |
| Replies: 5 Views: 601 Ok. Here is the code.
#include <iostream>
int main() {
int i;
int number=1;
char charachter;
cout<<"Please enter a charachter: ";cin<<charachter;
cout<<"\nPlease enter a... |
Forum: C++ Feb 21st, 2008 |
| Replies: 5 Views: 601 Post what you have done and we will see and correct. I won't do your homework. |
Forum: C++ Feb 21st, 2008 |
| Replies: 8 Views: 2,154 You thing that for (x = 0; x < 2000000000; x++)
will work quickly??? Mad boy. If you start this loop without any operations it will be VERY long.... |
Forum: C++ Feb 15th, 2008 |
| Replies: 26 Views: 3,791 // reading a text file
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
char line[100];
string words[10];
int i=0; |
Forum: C++ Feb 15th, 2008 |
| Replies: 26 Views: 3,791 Try that, i think it is OK:
// reading a text file
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
string lines[10];
char word[10]; |
Forum: C++ Feb 15th, 2008 |
| Replies: 8 Views: 1,699 Type in the end of main cout<<val;
If it doesn't help use getch() from conio.h |
Forum: C++ Feb 15th, 2008 |
| Replies: 9 Views: 897 Of corse it won't. You shoul not return the val in main you should use cout<<val; |
Forum: C++ Feb 15th, 2008 |
| Replies: 26 Views: 3,791 I've typed some code. Try it.
// reading a text file
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
char line[100]; |
Forum: C++ Feb 15th, 2008 |
| Replies: 7 Views: 821 It is very big mistake to write printf(c);
Correct is printf("%c", c);.
Remember the definition:
printf(argument, ...); |
Forum: C++ Feb 15th, 2008 |
| Replies: 9 Views: 897 You must call switch in some fucntion, it is an operator not a function.
E.g.
int foo(char c) {
switch(c){
case 'B':return 0;break;
case 'N':return 1;break;
case 'R':return 2;break;... |
Forum: C++ Feb 15th, 2008 |
| Replies: 2 Views: 1,109 First write in your C file
#pragma comment(lib, "library_name")
where library_name is a name of your library file.
These errors can be produced, that your library doesn't have functions and... |
Forum: C++ Feb 13th, 2008 |
| Replies: 1 Views: 1,541 There is no way to mix .lib and .dll files between different platforms and compilers. |
Forum: C Feb 13th, 2008 |
| Replies: 3 Views: 742 If you do just simple equals and smth like that just do
char c;
int i;
i = int(c); |
Forum: C++ Feb 13th, 2008 |
| Replies: 4 Views: 1,815 I correct your VERY simple syntax mistake.
Here is correct code:
#include <iostream>
#include "point.h"
using namespace std;
void rotate(point &p); |
Forum: C++ Feb 13th, 2008 |
| Replies: 10 Views: 1,362 case 'R':
case 'r':
/*blablabla*/
break;
Please put break ok? |
Forum: C Feb 13th, 2008 |
| Replies: 4 Views: 2,152 Is is hardware independent. Give me OS, may be I know some. But not for Mac, sorry. |
Forum: C++ Feb 12th, 2008 |
| Replies: 25 Views: 5,555 #include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
const int max_len = 1000;
enum boolean {false, true};
enum {EMPTY = -1, FULL = max_len - 1}; |
Forum: C++ Feb 12th, 2008 |
| Replies: 25 Views: 5,555 This is really OOP with C++. You can make this trick with numbers, strings, doubles, another classes and what you want. Really it is a standart problem. Is it works properly? |