Click here to Skip to main content
15,850,634 members

Comments by longjmp (Top 11 by date)

longjmp 13-Dec-22 4:28am View    
I understand that you need to put some c++ code in .sc files instead of .cpp files, if that's the case, it's no problem, the VC++ compiler provides the option to treat any file as a c++ source file, and you can set /Tp filename.sc to do that.
longjmp 13-Dec-22 4:28am View    
Deleted
I understand that you need to put some c++ code in .sc files instead of .cpp files, if that's the case, it's no problem, the VC++ compiler provides the option to treat any file as a c++ source file, and you can set /Tp filename.sc to do that.
longjmp 1-Dec-22 0:45am View    
thank you merano99, I think I just replied to Деян Цонев's question:
"Also I think the cast to void* could affect the value of the const char * despite it constant value imperative could not be changed ."
longjmp 30-Nov-22 16:36pm View    
cast const char* to void* will not modify its characters,
even casting from writable char* to void*,
the 'casting' just got an address value (a pointer),
but never change the contents that pointer referenced.
you can check it by code:
#include <iostream>

using namespace std;

int main(){

const char* p = "xxxxxxzzzzyy";
char c[] = "zUUUU";

cout << p << endl;
void* p2 = (void*)p;
cout << (char*)p2 << endl;
cout << (const char*)p2 << endl;


p2 = (void*)c;
cout << (char*)p2<
longjmp 29-Nov-22 3:53am View    
move the if {...} sentence into main {} like this: #include<stdio.h> int main() { float FSc, NTS; printf("Enter FSc marks:"); scanf("%f",&FSc); printf("Enter NTS marks:"); scanf("%f",&NTS); if(FSc>70) { if(NTS>=70) { printf("Congrats, you have been accepted in IT Department, Oxford University!"); } else(NTS>=60) { printf("Congrats, you have been accepted in Electronics Department, Oxford University!"); } } return 0; // add a return sentence }