Click here to Skip to main content
15,896,269 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Error during compilation that I dont understand. Pin
stianhh22-Nov-09 9:37
stianhh22-Nov-09 9:37 
GeneralRe: Error during compilation that I dont understand. Pin
Richard MacCutchan22-Nov-09 11:41
mveRichard MacCutchan22-Nov-09 11:41 
AnswerRe: Error during compilation that I dont understand. Pin
Cedric Moonen22-Nov-09 3:58
Cedric Moonen22-Nov-09 3:58 
QuestionCode snippet for searching a file in directory (directory can have subdirectories in it) Pin
V K 221-Nov-09 19:16
V K 221-Nov-09 19:16 
AnswerRe: Code snippet for searching a file in directory (directory can have subdirectories in it) Pin
22491721-Nov-09 19:47
22491721-Nov-09 19:47 
AnswerRe: Code snippet for searching a file in directory (directory can have subdirectories in it) Pin
breezes2008_22-Nov-09 0:35
breezes2008_22-Nov-09 0:35 
AnswerRe: Code snippet for searching a file in directory (directory can have subdirectories in it) Pin
T210222-Nov-09 12:28
T210222-Nov-09 12:28 
QuestionConverting "C++" language code code to "C" language code. [modified] Pin
hivicky21-Nov-09 17:55
hivicky21-Nov-09 17:55 
I wrote a program in C++ to store student details. Basically it stores 5 student's registration numbers with their GPAs and there are other functions in the program too.
I'm trying to convert the code to work in 'C' but I'm getting too many errors, especially where the arrays are concerned.
It would be very helpful if anyone could point me in the right direction or even give me a piece of the converted "C" code because that way I'll know what to change as I know C++ but I don't know C.
A piece of my C++ code i.e. the case1 statement is as follows:


#include*stdio.h
#include*stdlib.h

int main()
{

const int size = 5;
float gpa[size],sum=0,avg;
int i,regno[size],reg,flag=0;
char value;
while(value!='0')
{//start of while
cout<<"\t\t\t---MAIN MENU---\n\n\n\n";
cout<<"\n\nPress 1 to enter GPA(s) and registration number(s)";
cout<<"\n\nPress 2 to upgrade GPA(s)";
cout<<"\n\nPress 3 to display average of all the entered GPAs";
cout<<"\n\nPress 4 to display all the GPAs and regestration numbers";
cout<<"\n\nPress 5 to display registration number(s) of GPA of 4 holders";
cout<<"\n\nPress 0 to exit the program";
cout<<"\n\n\n\n\nEnter value = ";
cin>>value;

if(value=='0')
{
break;
}

switch(value)
{
case '1':

for(i=0;i*is less than*size;i++)
{
cout<<"\t\t\tENTER DATA\n\n\n\n";
cout<<"\n\n\nEnter GPA of student: "<<i+1<<" :="" ";
="" cin="">>gpa[i];
cout<<"\n\n\nEnter registration number of student: "<<i+1<<" :="" ";
="" cin="">>regno[i];
}

cout<<"\n\n\n\t\tPress any key to go back to the main menu";
getch();
break;
}
}


modified on Sunday, November 22, 2009 12:11 AM

AnswerRe: Converting "C++" language code code to "C" language code. Pin
Rajesh R Subramanian21-Nov-09 18:29
professionalRajesh R Subramanian21-Nov-09 18:29 
AnswerRe: Converting "C++" language code code to "C" language code. Pin
Richard MacCutchan22-Nov-09 1:58
mveRichard MacCutchan22-Nov-09 1:58 
AnswerRe: Converting "C++" language code code to "C" language code. Pin
tyftyftyf22-Nov-09 17:44
tyftyftyf22-Nov-09 17:44 
QuestionHow to initialize a modal dialog's controls? Pin
timbk21-Nov-09 11:38
timbk21-Nov-09 11:38 
AnswerRe: How to initialize a modal dialog's controls? Pin
timbk21-Nov-09 13:07
timbk21-Nov-09 13:07 
QuestionNumber Matching Pin
Humayun Kabir Hemoo21-Nov-09 0:19
Humayun Kabir Hemoo21-Nov-09 0:19 
AnswerRe: Number Matching Pin
Rozis21-Nov-09 1:49
Rozis21-Nov-09 1:49 
AnswerRe: Number Matching Pin
T210221-Nov-09 2:37
T210221-Nov-09 2:37 
AnswerRe: Number Matching Pin
Humayun Kabir Hemoo21-Nov-09 3:37
Humayun Kabir Hemoo21-Nov-09 3:37 
Questionmap saves class object and function pointer gives error [modified] Pin
Chanchalgaud20-Nov-09 22:42
Chanchalgaud20-Nov-09 22:42 
AnswerRe: map saves class object and function pointer gives error Pin
Cedric Moonen20-Nov-09 23:35
Cedric Moonen20-Nov-09 23:35 
AnswerRe: map saves class object and function pointer gives error Pin
Richard MacCutchan20-Nov-09 23:42
mveRichard MacCutchan20-Nov-09 23:42 
QuestionSHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
Chesnokov Yuriy20-Nov-09 22:11
professionalChesnokov Yuriy20-Nov-09 22:11 
AnswerRe: SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
Rozis21-Nov-09 2:00
Rozis21-Nov-09 2:00 
QuestionRe: SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
Chesnokov Yuriy21-Nov-09 8:23
professionalChesnokov Yuriy21-Nov-09 8:23 
QuestionRe: SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
22491721-Nov-09 20:15
22491721-Nov-09 20:15 
AnswerRe: SHGetSpecialFolderPath(NULL, dir, CSIDL_LOCAL_APPDATA, FALSE) special path Pin
Chesnokov Yuriy21-Nov-09 21:26
professionalChesnokov Yuriy21-Nov-09 21:26 

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.