Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCreate Window Region using CodeBlocks Pin
Luca D'Amico13-Nov-13 3:27
Luca D'Amico13-Nov-13 3:27 
SuggestionRe: Create Window Region using CodeBlocks Pin
Richard MacCutchan13-Nov-13 5:56
mveRichard MacCutchan13-Nov-13 5:56 
GeneralRe: Create Window Region using CodeBlocks Pin
Luca D'Amico15-Nov-13 4:05
Luca D'Amico15-Nov-13 4:05 
AnswerRe: Create Window Region using CodeBlocks Pin
Albert Holguin14-Nov-13 5:09
professionalAlbert Holguin14-Nov-13 5:09 
GeneralRe: Create Window Region using CodeBlocks Pin
Luca D'Amico15-Nov-13 3:48
Luca D'Amico15-Nov-13 3:48 
QuestionLinked List Error in C programming Pin
caulsonchua11-Nov-13 20:38
caulsonchua11-Nov-13 20:38 
SuggestionRe: Linked List Error in C programming Pin
Richard MacCutchan11-Nov-13 22:41
mveRichard MacCutchan11-Nov-13 22:41 
AnswerRe: Linked List Error in C programming [updated, thanks David] Pin
CPallini12-Nov-13 3:50
mveCPallini12-Nov-13 3:50 
C++
int main()
{
    int i,value;
    char ch='y';
    head=NULL;


         printf("\nEnter Integers: ");
         scanf("%d",&value);
         insert_data(value);
         display();


    }// <------------------- SPURIOUS EXTRA '}' HERE
getch();
 }


You have a spurious an extra closing brace ('}') in your code. Remove it in order to correctly compile.


As it stands, you main function retrives just one integer from the user.
Change from
Quote:
scanf("%d",&value);
insert_data(value);
to
C++
while (scanf("%d", &value))
    {
        insert_data(value);
    }

This allows the user to enter many integers (one at time).
Inserting a not-valid-number (e.g. "foo") ends the insertion in the list.

Also, I suppose your reverse_list function is plainly wrong.
Veni, vidi, vici.


modified 13-Nov-13 11:14am.

GeneralRe: Linked List Error in C programming Pin
David Crow13-Nov-13 4:08
David Crow13-Nov-13 4:08 
GeneralRe: Linked List Error in C programming Pin
CPallini13-Nov-13 5:10
mveCPallini13-Nov-13 5:10 
QuestionRe: Linked List Error in C programming Pin
David Crow13-Nov-13 4:06
David Crow13-Nov-13 4:06 
Questiontime performance -global or local Pin
econy11-Nov-13 16:57
econy11-Nov-13 16:57 
QuestionRe: time performance -global or local Pin
Richard MacCutchan11-Nov-13 22:39
mveRichard MacCutchan11-Nov-13 22:39 
AnswerRe: time performance -global or local Pin
econy12-Nov-13 4:05
econy12-Nov-13 4:05 
AnswerRe: time performance -global or local Pin
econy12-Nov-13 4:09
econy12-Nov-13 4:09 
GeneralRe: time performance -global or local Pin
Richard MacCutchan12-Nov-13 4:55
mveRichard MacCutchan12-Nov-13 4:55 
AnswerRe: time performance -global or local Pin
Aescleal12-Nov-13 8:10
Aescleal12-Nov-13 8:10 
GeneralRe: time performance -global or local Pin
econy12-Nov-13 8:37
econy12-Nov-13 8:37 
QuestionCMFCRibbonStatusBar Without a Border Pin
Paul Harrison 211-Nov-13 10:17
Paul Harrison 211-Nov-13 10:17 
QuestionConvert Raster image to vector geometry Pin
002comp11-Nov-13 1:35
002comp11-Nov-13 1:35 
AnswerRe: Convert Raster image to vector geometry Pin
Joe Woodbury11-Nov-13 6:03
professionalJoe Woodbury11-Nov-13 6:03 
GeneralRe: Convert Raster image to vector geometry Pin
002comp11-Nov-13 17:17
002comp11-Nov-13 17:17 
GeneralRe: Convert Raster image to vector geometry Pin
Joe Woodbury11-Nov-13 17:35
professionalJoe Woodbury11-Nov-13 17:35 
QuestionHow to find the Process ID of TAPI Service in windows by using VC2000 Pin
DSPCottage10-Nov-13 19:02
DSPCottage10-Nov-13 19:02 
QuestionRe: How to find the Process ID of TAPI Service in windows by using VC2000 Pin
Richard MacCutchan10-Nov-13 21:12
mveRichard MacCutchan10-Nov-13 21:12 

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.