Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
71% Quality Score
Upvotes Received
6
Posts with Upvotes
6
Upvoting Members
3
Downvotes Received
2
Posts with Downvotes
2
Downvoting Members
2
0 Endorsements
~10.5K People Reached
Favorite Tags
c++ x 22
c x 11

23 Posted Topics

Member Avatar for camelNotation

To Valmian: Comunicating functions are like: class none { int x; public: int& getx() { return x; } }; I getx() such a function? :?:

Member Avatar for tekbhatta
1
2K
Member Avatar for Asif_NSU

Do you think it actually matters?! If you have: [code] int a=new int[8]; a[0]=23; delete a; cout<<a[0]; [/code] It prints 23. The same thing applies for delete[]. Why bother deallocating it? I have a question of my own! If you use: [code] int *a,n,i=0; printf("%i",&n) for (i;i<n;i++) a[i]=i; for (i=0;i<n;i++) …

Member Avatar for ahtaniv
0
792
Member Avatar for rodkay

How exactly do you want to get length?!! The only way I know of is using <string.h> There is a strlen(char *s) function which return the strings length :D

Member Avatar for ashishkumar008
1
175
Member Avatar for Saleh

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 header.txt/cpp/in/out/... you use it through: #include "..." if you have variables in your header, do not redeclare them in your programs or it will …

Member Avatar for JCRARY
4
275
Member Avatar for matika

The answer is quite simple: Just use "<"or">" operators in an "if" instruction like in a normal sorting method for numbers. Be careful though: if you have: s1[]="abcdef",s2[]="afsdg"; and you write if (s1>s2) printf("1"); else printf("2"); it will write 2 as in s2 larger than s1 so s1 has to …

Member Avatar for sachin_mnnit
1
759
Member Avatar for Tejas

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 elemget(int n) { long val=0; for (int j=1;j<=n;j++) val+=(j*2)*(j*2); return val; } void main() { clrscr(); int n; printf("Numarul de termeni:");scanf("%i",&n); unsigned …

Member Avatar for WaltP
1
236
Member Avatar for Sukhbir
Member Avatar for Lippy

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; }; nod *vf,*sf;// *vf-is the the first element in the list // *sf- is the last element void add(int val,nod* &vf) { if (!vf) //lista …

Member Avatar for Narue
1
206
Member Avatar for MaxC

It should be answer (b) Here's an example: [code] #include <iostream.h> main() { char s[100]; cin.getline(s,100); cout<<s; } [/code] So, cin.getline(char_array,max_lenght_of_array); :lol:

Member Avatar for azeembutt
0
282
Member Avatar for Robin Low

Please give me all the details about your assignment-- exactly what must it do. I'd be more than happy to write a source file :p Give me your e-mail and i'll send you the program! (it might be wrong ; i'm just 13)

Member Avatar for Narue
0
148
Member Avatar for Mahen

For reading you use scanf() with format specifier "%f","%g","%e" or printf(); the variable tyoe is float and functions are in math.h You need functions->read tutorials

Member Avatar for Dave Sinkula
0
181
Member Avatar for Fili

I want to have a class LIST -- a dinamic list of rational numbers (defined previously in my RATIONAL class). I want another class STACK to inherit LIST's root and end pointers for my list.(STACK also is dinamical) Please help because it says that STACK cannot access the root and …

1
107
Member Avatar for silicon

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: [code] fstream in("...",ios::in); fstream out("...".ios::out); char *s=new char[...]; in.getline(s,100,'\n'); [/code] The getline function is a method for istream and …

Member Avatar for silicon
0
317
Member Avatar for boi86

How about: [code] #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; char fn[20],mn[20],ln[20]; cin>>fn>>mn>>ln; fn[0]=toupper(fn[0]); mn[0]=toupper(mn[0]); ln[0]=toupper(ln[0]); cout<<ln<<", "<<fn<<" "<<mn[0]<<"."; } [/code] :)

Member Avatar for Fili
0
153
Member Avatar for newbeginney

Hmm how about declaring 2 macros: [code] #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++) { max=max(max,x[i]); min=min(min,x[i]); } ... [/code] I hope it's write since I didn't test it. :o

Member Avatar for newbeginney
0
214
Member Avatar for nufanvandal

ok i've written some code for you. it reads the number of rows and columns and prints the drawing. [code] #include <stdio.h> #include <conio.h> void main() { clrscr(); int m,n,i,j; printf("Number of rows:");scanf("%i",&n); printf("Number of columns:");scanf("%i",&m); for (j=0;j<n;j++) printf("$$"); printf("\n"); i=0; while (i<m) { printf("$$"); for (j=1;j<n-1;j++) printf(" "); printf("$$\n"); …

Member Avatar for red_evolve
0
275
Member Avatar for 3maddy3

I've used them in a Snake game. I don't remember exactly but something like #77... :?: Check the ASCII code. You'll certainl find them there :)

Member Avatar for meabed
0
226
Member Avatar for mike3x1
Member Avatar for K-1
1
191
Member Avatar for Fili

I have a very important question (for me) How do i use <alloc.h>/<malloc.h>/<stdlib.h> for memory allocation? i'm talking about: malloc(),calloc(),halloc(),realloc(),alloca(),heapwalk(),free() etc? i'm having a lot of trouble with these! thank you!! :confused:

Member Avatar for Fili
0
223
Member Avatar for phish1429
Member Avatar for Fili
1
2K
Member Avatar for matika

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 ...printf() functions. The difference is that it reads and writes in colours! The textcolor is changed through textcolor() function described by …

Member Avatar for Fili
0
435
Member Avatar for Blood Night

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 [email]yuri@fx.ro[/email]-could you send answer here? )

Member Avatar for Fili
2
261
Member Avatar for Neofite

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:

Member Avatar for FireNet
2
197

The End.