Forum: C++ Jul 14th, 2004 |
| Replies: 7 Views: 17,809 To Valmian: Comunicating functions are like:
class none
{
int x;
public:
int& getx()
{
return x;
}
}; |
Forum: C++ Jul 14th, 2004 |
| Replies: 4 Views: 2,313 How about:
#include <iostream.h>
#include <ctype.h>
#include <conio.h>
void main()
{
cout<<"please enter first name, middle name and last name"<<endl;
cout<<"(max 20 chars each)"<<endl;... |
Forum: C++ Jul 14th, 2004 |
| Replies: 2 Views: 7,007 Well it's obvious you're using some sort of template or something I on't understand. To read text from a file use fgets(char *s,int nrchr,FILE *inpfile);
Since you're using fstream go for:
... |
Forum: C++ Jul 8th, 2004 |
| Replies: 13 Views: 31,079 To Dave: Thanks a lot. I've figured out why it sometimes would work and other times it would crash! When a pointer is declared in main(), it has a residual adress to a memory block. Therefore, it can... |
Forum: C++ Jul 5th, 2004 |
| Replies: 5 Views: 3,084 Hmm how about declaring 2 macros:
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
int max,int min;
...
max=max(x[0],x[1]);
min=min(x[0],x[1]);
for (i=2;i<n;i++)
{ |
Forum: C++ Jul 5th, 2004 |
| Replies: 13 Views: 31,079 TO Asif_NSU:I must admit that in Dev C++ this doesn't work at all. BUT in the DOS version it WORKS very well. I'm using Borlamd C++ 3.1. This thing is highly useful for ME. I will be in the 8th form... |
Forum: C++ Jul 3rd, 2004 |
| Replies: 13 Views: 31,079 Do you think it actually matters?!
If you have:
int a=new int[8];
a[0]=23;
delete a;
cout<<a[0]; |
Forum: C++ Jun 21st, 2004 |
| Replies: 11 Views: 16,081 ahh ok I see. Thanks Dave :) |
Forum: C++ Jun 20th, 2004 |
| Replies: 11 Views: 16,081 Well, that's what his problem said. Anyway i'm not a US or UK citizen so i'm not great at english :sad: What is a vending machine exactly?! :o |
Forum: C++ Jun 20th, 2004 |
| Replies: 6 Views: 15,844 I know they won't work in Visual C but I'm a Borland C++ (for DOS) user. :!: |
Forum: C++ Jun 19th, 2004 |
| Replies: 11 Views: 16,081 Thanks Fire Net :D Do you suppose it's too late for it to be of any use? |
Forum: C++ Jun 19th, 2004 |
| Replies: 11 Views: 16,081 ok... it's ready but it doesn't cover the part where the option is invalid ;)
#include <iostream.h>
#include <conio.h>
int dol,cen;
unsigned int cb=0,ch;
void convert(int cb)
{
... |
Forum: C++ Jun 19th, 2004 |
| Replies: 11 Views: 16,081 I'm writing your program though it might be too late! ;) |
Forum: C++ Jun 18th, 2004 |
| Replies: 6 Views: 15,844 You're right Fire Net.
The colour list is ok. you know that's why i use printf/scanf
In <conio.h> you may find: cprintf(...);cscanf(...) with the same paramters as ...scanf() and... |
Forum: C++ Jun 18th, 2004 |
| Replies: 4 Views: 3,287 Just asking Blood Night: What does output say?
what does 1n mean 1*n or 1n as a number; what do you mean???
( for all interested my e-mail is yuri@fx.ro-could you send answer here? ) |
Forum: C++ Jun 18th, 2004 |
| Replies: 6 Views: 16,730 It should be answer (b)
Here's an example:
#include <iostream.h>
main()
{
char s[100];
cin.getline(s,100);
cout<<s;
} |
Forum: C++ Jun 18th, 2004 |
| Replies: 14 Views: 5,221 woops i'm from romania. "Numarul de termeni:" means how many elements you will input and "Suma obtinuta" means the sum you have obtained. My mistake! :o |
Forum: C++ Jun 18th, 2004 |
| Replies: 5 Views: 25,687 well if you include main() in a header that would be more like a program than like a header but anyway you can ;) |
Forum: C++ Jun 17th, 2004 |
| Replies: 14 Views: 5,221 Red_evolve... i've written a version for Q1 myself and it's pretty similar to yours (mine's a program---in my opinion you understood pretty good)
#include <stdio.h>
#include <conio.h>
long... |
Forum: C++ Jun 17th, 2004 |
| Replies: 5 Views: 25,687 It is very very simple:
write some functions||define some macros||define structures/classes etc...
DO NOT include a main() function
save it with the name you want
e.g... |
Forum: C++ Jun 17th, 2004 |
| Replies: 6 Views: 2,251 Well i'm a teen-ager myself (13). I recomend learning the PASCAL language then go to C. Pascal is far more basic; it doesn't have as many functions as C
BUT it is easier to use :mrgreen: |
Forum: C++ Jun 16th, 2004 |
| Replies: 5 Views: 35,405 Ok--try this (i'm not sure it's perfect...13 yr olds can make mistakes)
#include <stdio.h>
#include <conio.h>
#include <alloc.h>
struct nod
{
int info;
nod *adr;
}; |