Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
In turbo c 3.2 I am getting
Divide error
and in code blocks IDE I getting error that
initgraph() and closegraph() are refrence at compile time. (I added graphics header and library file in folder of codeblocks).Please give me solution?
the code i written is
#include<graphics.h>
int main()
{
int a=10,ab;
initgraph(&a,&ab,"C:\\TURBOC3\\BGI");
circle(100,200,20);
closegraph();
return 0;
}
In addition to the backslash issue in the path, it's extremely unlikely that you are using a 3270 compatible display. Why don't you pass in the address of a with a=0. ab must be set to a requested mode unless you set the driver to autodetect, which will then select the highest available mode. See here.
The path string should be "C:\\TURBOC3\\BGI" (note the double backslashes instead of single backslashes)
I hope this solves the problem. I can't see any other error in code.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
When debugging code, when it comes to the rand () function, it asks where the file is. This file is not in libraries at all. What to do?
Your debugger is looking for source code to make itself more useful. In the case of compiled files that are part of glibc, that's not on your system. The path shown is just the path in the original build environment; that's irrelevant. It can use random.c if found elsewhere, but you need to tell it where to look.
The good news is that you can probably install a package to make this work. Which one depends on your operating system; you did not tell us what that is.
However I'd just hit "cancel". You don't need to debug the internals of glibc, unless you're actually trying to find bugs in glibc.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I would like to run a what I called "script C code" from string in my C++ program, for exemple :
int main(){
// my string (from a file): printf("Hello, Stackoverflow!")
RunScript(MyStringScript);
return 0;
}
I could use clang or other, but I have no idea how to do that...
PS: The goal is not to make a C interpreter, no, just run a C code to broaden my program.
The best way for reaching your goal, is to use a C interpreter library.
For example you can use this one: https://github.com/jpoirier/picoc
You could also do it with libjit. Because you are then running the system compiler, any ISO C/C++ code can be compiled (picoc is not fully ISO C complete)
Obligatory disclaimer: Running user supplied code at runtime is very dangerous unless it is properly sandboxed. Maybe consider doing it another way.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am a first time user of stack overflow, and a newbie programmer. I was looking for a free IDE and I came across Codelite. I downloaded it and ran it, but Kaspersky flagged codelite-terminal.exe and two programs in the program setup file as viruses. I downloaded it from the official source forge website. Please advise. Thank you for your time!!!
It does not contain any viruses. You can always download the code and search for them ;) - thats the beauty of open source
Don't believe everything Kaspersky tells you...
Eran Ifrah
Author of CodeLite IDE
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have just bought accelerated c++ used. It wants me to do a project but i have no clue on what, does any one have a clue i searched online for a answer but nothing or at less one that would work. The program it want me to do is this
write a program that, when run, writes
this (") is a qute, and this (/) is a backslash
3 + 4;
There is no particular implementation you're supposed to use. You simply use whatever you've got. If you're on Windows you can get Visual Studio Express. If you're on linux you can use gcc, if you're on OS X you can get Xcode, etc.
Accelerated C++ is not intended for individuals new to programming; It's intended to get a programmer with experience in another language up and running in C++ quickly. You may find a different book more suited to your needs.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
We need to write a C/C++ code that will check whether the memory allocated to the program at the initial and the memory returned to the system is the same or not.
My idea is to find the memory usage at beginning and at ending and subtract.
But how to find the memory usage?
Any other idea please.
If you are using the Linux/Unix based OS , you can involve the top utility ans see the difference.no need to reinvent the wheel.
use this in your c code :
uint find_memory_usage()
{
sprintf(cmd, "/bin/top");
system(cmd);
}
You can use exec family functions or system call as well for this.
This link on SO may also help.
or this one.
I think this code will help you to find size of your c code:
#include<stdio.h>
#include<bios.h>
int main(void)
{
printf("memory size %d kbite\n", biosmemory());
return 0;
}