Click here to Skip to main content
15,562,144 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error C2440 Pin
MsmVc4-Apr-10 22:55
MsmVc4-Apr-10 22:55 
GeneralRe: error C2440 Pin
Adam Roderick J4-Apr-10 23:00
Adam Roderick J4-Apr-10 23:00 
GeneralRe: error C2440 Pin
MsmVc4-Apr-10 23:06
MsmVc4-Apr-10 23:06 
GeneralRe: error C2440 Pin
Adam Roderick J4-Apr-10 23:21
Adam Roderick J4-Apr-10 23:21 
GeneralRe: error C2440 Pin
MsmVc4-Apr-10 23:31
MsmVc4-Apr-10 23:31 
GeneralRe: error C2440 Pin
Game-point4-Apr-10 23:45
Game-point4-Apr-10 23:45 
GeneralRe: error C2440 Pin
MsmVc5-Apr-10 0:11
MsmVc5-Apr-10 0:11 
GeneralRe: error C2440 Pin
Emilio Garavaglia5-Apr-10 22:04
Emilio Garavaglia5-Apr-10 22:04 
no, no, no .... That's not the way to go!
You put some code with some syntax error and even some misconception in it.
That reveal that you are not understanding what your code has to do.

The compiler just gives some errors, but those errors are random as your code is. Attempting to fix those errors doesn't lead anywhere: you're never granted your code will do what you expect.

For example:
char *s;
int i,l,*a,f,c,x;
printf("Enter a string : ");
scanf("%s",s);


s is a pointer pointing to nowhere: where do ypu thoing your scanf can write to ?!?
s[l]=0; tries to write to nowhere since s is nowhere
a is a pointer to int, but you do a=(char*)malloc(l): what did you want to do? allocating char-s or int-s ?!
for(i=0;i
 f=1,c=0;
 while(f)

This is a mess of tokens with no syntax meaning! Raed about the for syntax, and understand the proper use of '()', ',', and ';'.


x=l-1 Wow... you're looking for problems: never use names like "O" and "l": I have to change font before find it's "l-1" and not "l-l" ... Do you get what I mean? If not, than that demonstrate the problem Smile | :)

Then: I see a malloc, but i don't see a free: not a good way to program...

I don't continue, but what can you do if you don't have clear in your mind what you're gonna do?

2 bugs found.
> recompile ...
65534 bugs found.
D'Oh! | :doh:


GeneralRe: error C2440 Pin
MsmVc5-Apr-10 22:12
MsmVc5-Apr-10 22:12 
GeneralRe: error C2440 Pin
Emilio Garavaglia5-Apr-10 22:46
Emilio Garavaglia5-Apr-10 22:46 
GeneralRe: error C2440 Pin
MsmVc5-Apr-10 23:00
MsmVc5-Apr-10 23:00 
GeneralRe: error C2440 Pin
Emilio Garavaglia5-Apr-10 23:10
Emilio Garavaglia5-Apr-10 23:10 
GeneralRe: error C2440 Pin
MsmVc5-Apr-10 23:13
MsmVc5-Apr-10 23:13 
AnswerRe: error C2440 Pin
Fareed Rizkalla5-Apr-10 0:12
Fareed Rizkalla5-Apr-10 0:12 
GeneralRe: error C2440 Pin
MsmVc5-Apr-10 0:28
MsmVc5-Apr-10 0:28 
GeneralRe: error C2440 Pin
Fareed Rizkalla5-Apr-10 5:14
Fareed Rizkalla5-Apr-10 5:14 
GeneralRe: error C2440 Pin
MsmVc5-Apr-10 20:13
MsmVc5-Apr-10 20:13 
QuestionHow can generate Max. Combination of given Value? Pin
Le@rner4-Apr-10 20:58
Le@rner4-Apr-10 20:58 
AnswerRe: How can generate Max. Combination of given Value? Pin
Adam Roderick J4-Apr-10 21:02
Adam Roderick J4-Apr-10 21:02 
GeneralRe: How can generate Max. Combination of given Value? Pin
Le@rner4-Apr-10 21:19
Le@rner4-Apr-10 21:19 
GeneralRe: How can generate Max. Combination of given Value? Pin
Adam Roderick J4-Apr-10 22:01
Adam Roderick J4-Apr-10 22:01 
GeneralRe: How can generate Max. Combination of given Value? Pin
Le@rner4-Apr-10 22:24
Le@rner4-Apr-10 22:24 
GeneralRe: How can generate Max. Combination of given Value? Pin
Adam Roderick J4-Apr-10 22:35
Adam Roderick J4-Apr-10 22:35 
GeneralRe: How can generate Max. Combination of given Value? Pin
Le@rner4-Apr-10 22:39
Le@rner4-Apr-10 22:39 
GeneralRe: How can generate Max. Combination of given Value? Pin
CPallini5-Apr-10 1:11
mveCPallini5-Apr-10 1:11 

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.