Forum: C Oct 8th, 2004 |
| Replies: 20 Views: 5,014 I actually worked out the exercise with a double array , as you said ( a[5][80 ). But I was just churious about mohammad's version . :rolleyes: |
Forum: C Oct 8th, 2004 |
| Replies: 20 Views: 5,014 I want it with #include <iostream> and all the rest ( cout & cin) . This one doesn't work:
#include <iostream>
#include <conio.h>
using namespace std;
main()
{ char *a[5]; int i;... |
Forum: C Oct 6th, 2004 |
| Replies: 20 Views: 5,014 Indeed , I haven't tested them until now. It seems like both versions give the same result ...
My guess is: i should start from 0? :p |
Forum: C Oct 6th, 2004 |
| Replies: 20 Views: 5,014 Hehe. :) It should be like this:
for(i=1;i<=n;i++)
NOT
for(i=1;i<=n;++i) |
Forum: C++ Oct 5th, 2004 |
| Replies: 9 Views: 18,432 I apologize. That one I didn't test. Here is the correct version , tested :cheesy: :
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{ int a[50],b[50],i,j,n;... |
Forum: C++ Oct 5th, 2004 |
| Replies: 27 Views: 126,670 Try
#include <iostream.h>
void main()
{ ...... /* your program here */
cin.get();
}
It should work . |
Forum: C Oct 5th, 2004 |
| Replies: 20 Views: 5,014 It works fine as for(i=1;i<=n;i++) . Trust me. :lol: |
Forum: C Oct 5th, 2004 |
| Replies: 20 Views: 5,014 It works , altought the exercise says that I should use two arrays , one for the names and one for the grades. Oh well , it's important that it works ... :)
Thank you very much! |
Forum: C Oct 5th, 2004 |
| Replies: 20 Views: 5,014 Do you mean something like
a[1][1] = "Victor";
a[2][2] = "Jose"; ???
I mean:
char a[30][30],i,n;
cout<<"n= "; cin>>n;
for(i=1;i<=n;i++) { cout<<"Give "<<i<<"-st name: "; cin>>a[i]; }
... |
Forum: C++ Oct 5th, 2004 |
| Replies: 9 Views: 18,432 It'll be something like this:
#include <iostream.h>
#include <conio.h>
void main()
{ clrscr(); int a[50],b[50],i,n,g;
cout<<"Give the number of elements of both vectors: "; cin>>n;... |
Forum: C Oct 5th, 2004 |
| Replies: 20 Views: 5,014 As this is my first post on this forum I want to say "Hello!" to everybody and I hope that we'll help each other as much as we can and we'll be very good friends. :)
So, this is my problem ( a... |