dev-c++

Scanf is not scanning %c character but skips the statement, why is that? [duplicate]

可紊 提交于 2019-12-28 03:03:08
问题 This question already has answers here : scanf() leaves the new line char in the buffer (4 answers) Closed 8 months ago . I wrote a program using switch case statement and asked for a char for input but it does not ask for the char in the console window but skips it completely int main() { float a, b, ans; char opr; printf("\nGIVE THE VALUES OF THE TWO NUMBERS\n"); scanf(" %f %f",&a,&b); printf("\nGIVE THE REQUIRED OPERATOR\n"); //no display(echo) on the screen //opr = getch(); //displays on

confliction type for a user defined function in c

删除回忆录丶 提交于 2019-12-26 06:01:13
问题 I am working in c after a long time.Here i have to achieve three functionality which includes get a number and show half 2.Get the square of the number 3.Get two number and show their summation and sabtraction. I am using devC++ and when i compile the code i get the error i mentioned in the title which conflict type if squareInput .What is wrong here: #include<stdio.h> #include<conio.h> int main(){ float x; printf("enter a number\n"); scanf("%f",&x); //TASK 1 : display half of the number

confliction type for a user defined function in c

懵懂的女人 提交于 2019-12-26 06:00:11
问题 I am working in c after a long time.Here i have to achieve three functionality which includes get a number and show half 2.Get the square of the number 3.Get two number and show their summation and sabtraction. I am using devC++ and when i compile the code i get the error i mentioned in the title which conflict type if squareInput .What is wrong here: #include<stdio.h> #include<conio.h> int main(){ float x; printf("enter a number\n"); scanf("%f",&x); //TASK 1 : display half of the number

Bloodshed Dev-C++ compiler errors *Binary Trees

天大地大妈咪最大 提交于 2019-12-25 16:58:27
问题 I would like feedback on my code please. It is an assignment for school where we were asked to write a function that swaps the left and right side binary trees. Our class that our professor gave us was swapBinaryTrees and the rest was left up to us. I am getting a whole lot of compiler errors and I am not sure where I am going wrong with my syntax. I am getting errors when I compile it like line 14 expected init-declarator '<'token the line in reference is void binaryTreeSearch<elemType>:

Bloodshed Dev-C++ compiler errors *Binary Trees

拈花ヽ惹草 提交于 2019-12-25 16:57:47
问题 I would like feedback on my code please. It is an assignment for school where we were asked to write a function that swaps the left and right side binary trees. Our class that our professor gave us was swapBinaryTrees and the rest was left up to us. I am getting a whole lot of compiler errors and I am not sure where I am going wrong with my syntax. I am getting errors when I compile it like line 14 expected init-declarator '<'token the line in reference is void binaryTreeSearch<elemType>:

Saving Image to Memory

為{幸葍}努か 提交于 2019-12-25 10:25:10
问题 I have an dev-c++ Application which makes an Screenshot and writes it into an File. Now I want to write the image into an Variable/Stream. Originally I used three Writefile Functions, which write the header, the info and the hbitmap into an file. Now I want to save the data not to the file, but to an Stream, so I can use it for further processing. The Code I use is this: /* <Include> */ #include <windows.h> #include <iostream> #include <sstream> /* </Include> */ /* <Const> */ const char

Close my program before Windows shutdown

喜欢而已 提交于 2019-12-25 04:12:37
问题 I´m making a program that must save its files without user interaction when the computer is being turned off. I tried, but I cannot understand how to do it, because most of the info I found is for C#. I found the SystemEvents::SessionEnding event using the below code for C++, but I don´t know how to implement this in dev-c++: public: event SessionEndingEventHandler^ SessionEnding { static void add(SessionEndingEventHandler^ value); static void remove(SessionEndingEventHandler^ value); } } 回答1

“cannot open output file filename.exe: Permission denied”

前提是你 提交于 2019-12-24 14:25:00
问题 I have just learned C++ and I am trying to make a program using the windows.h header. I am using the Dev-C++ compiler and i am getting three errors that I can't find a solution to. These are the errors: cannot open output file filename.exe: Permission denied [Error] ld returned 1 exit status recipe for target 'filename.exe' failed Here is my code: #include &#60windows.h&$62 #include &#60iostream&#62 #include &#60fstream&#62 #include &#60string&#62 #include &#60vector&#62 using namespace std;

Compiles smoothly, does not run, no output (C)

雨燕双飞 提交于 2019-12-24 11:42:13
问题 I was just copying some sample programs taken from the book The C Programming Language by Kernighan and Ritchie . This is one of its examples, a program that claims to convert a C-string inputted to its floating point equivalent: #include <ctype.h> /* atof: convert string s to a double */ double atof(char s[]) { double val, power; int i, sign; for (i = 0; isspace(s[i]); i++); /* skip white spaces */ sign = (s[i] == '-') ? -1 :1; if (s[i] == '+' || s[i] == '-') i++; for (val = 0.0; isdigit(s[i

Why so many additional sections in the PE file after compiling by Dev C++?

余生长醉 提交于 2019-12-24 07:35:27
问题 I wrote some simple code by C/C++ ,compiling by Dev C++(MinGW) in PE format on win10 . I used the tool "Stud PE" to review the PE file structure of the compiled exe as follows: As you can see,in addition to the normal file sections like .text ,.data , .bss ... , there are some other sections with the name like /4,/19,/31 ... . How can I know what's the purpose of these sections ? for debugging?? (but why so many sections with strange name ?) Is there any documentation or material to explain