Click here to Skip to main content
15,909,051 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerWrong forum Pin
CPallini30-Jan-09 22:36
mveCPallini30-Jan-09 22:36 
AnswerRe: convert row elements from two dimensional array to one dimensional arrays Pin
David Crow31-Jan-09 16:34
David Crow31-Jan-09 16:34 
QuestionProblem in printing- Please help me. Pin
Le@rner30-Jan-09 21:02
Le@rner30-Jan-09 21:02 
AnswerRe: Problem in printing- Please help me. Pin
Roger Allen4-Feb-09 14:15
Roger Allen4-Feb-09 14:15 
GeneralRe: Problem in printing- Please help me. Pin
Le@rner4-Feb-09 18:52
Le@rner4-Feb-09 18:52 
Questionproblem in [Insert Bitmap] , [Text utf-8 FONT] print Pin
mohammadmot30-Jan-09 19:27
mohammadmot30-Jan-09 19:27 
QuestionI HAVE SOME QUESTION..... Pin
arad.moradi30-Jan-09 10:04
arad.moradi30-Jan-09 10:04 
AnswerRe: I HAVE SOME QUESTION..... Pin
CPallini30-Jan-09 11:08
mveCPallini30-Jan-09 11:08 
arad.moradi wrote:
1:i made a constructor in class (at c++ )

cart(char a[2]){a[2]=('p','a','q');
cout << a[0]<<a[1]<<a[2];};


and i call it in main function like this:cart x;
i have this error in this line :cart x;
error C2512: 'cart' : no appropriate default constructor available.

Well the message is clear: you have to provide a default contructor (i.e. a constructor without arguments). If you don't supply any constructor then the compiler generates a default one for you, but that's not the case since you have provided a constructor accepting an argument.



arad.moradi wrote:
char left()
{
char a[2];
swap(a[0],a[1]);
for (int b=1;b>=2;b++)
cout << a[b];
return 'L';
};


but it didn't swap 2 char.and this function didn't use that variable in my constructor (char a[2]).
i hope can explain well


Here you are swapping elements 0 and 1 of an (uninitialized) array and then printing
the elements 1, 2 of it (going out of bounds).

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: I HAVE SOME QUESTION..... Pin
Code-o-mat30-Jan-09 23:21
Code-o-mat30-Jan-09 23:21 
QuestionXML/XPATH which C++ libraries? Pin
ntnass30-Jan-09 8:08
ntnass30-Jan-09 8:08 
AnswerRe: XML/XPATH which C++ libraries? Pin
Nemanja Trifunovic30-Jan-09 8:47
Nemanja Trifunovic30-Jan-09 8:47 
GeneralRe: XML/XPATH which C++ libraries? Pin
ntnass30-Jan-09 11:39
ntnass30-Jan-09 11:39 
QuestionRe: XML/XPATH which C++ libraries? Pin
CPallini30-Jan-09 11:10
mveCPallini30-Jan-09 11:10 
AnswerRe: XML/XPATH which C++ libraries? Pin
ntnass30-Jan-09 11:36
ntnass30-Jan-09 11:36 
GeneralRe: XML/XPATH which C++ libraries? Pin
CPallini30-Jan-09 12:27
mveCPallini30-Jan-09 12:27 
GeneralRe: XML/XPATH which C++ libraries? Pin
ntnass30-Jan-09 23:41
ntnass30-Jan-09 23:41 
GeneralRe: XML/XPATH which C++ libraries? Pin
Stephen Hewitt31-Jan-09 5:00
Stephen Hewitt31-Jan-09 5:00 
AnswerRe: XML/XPATH which C++ libraries? Pin
Stuart Dootson31-Jan-09 0:01
professionalStuart Dootson31-Jan-09 0:01 
GeneralRe: XML/XPATH which C++ libraries? [modified] Pin
ntnass31-Jan-09 0:05
ntnass31-Jan-09 0:05 
AnswerRe: XML/XPATH which C++ libraries? Pin
ntnass31-Jan-09 1:01
ntnass31-Jan-09 1:01 
GeneralRe: XML/XPATH which C++ libraries? [modified] Pin
ntnass31-Jan-09 3:22
ntnass31-Jan-09 3:22 
QuestionSetting CEdit tabstop to false at runtime Pin
sabapathy_8030-Jan-09 5:54
sabapathy_8030-Jan-09 5:54 
QuestionRe: Setting CEdit tabstop to false at runtime Pin
David Crow30-Jan-09 6:33
David Crow30-Jan-09 6:33 
AnswerRe: Setting CEdit tabstop to false at runtime [modified] Pin
sabapathy_8030-Jan-09 17:17
sabapathy_8030-Jan-09 17:17 
GeneralRe: Setting CEdit tabstop to false at runtime Pin
Michael Dunn30-Jan-09 6:40
sitebuilderMichael Dunn30-Jan-09 6:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.