C++ :: Program Working On Online Compiler But Not On Code Blocks
Jan 26, 2015
This program works on an online compiler but force closes on codeblocks after entering the elements.
#include<iostream>
using namespace std;
int two_print(int x, int one[999]) {
int two[999][999];
for(int k=0, r=x; k<=x; k++, r--)
[code]....
View 6 Replies
ADVERTISEMENT
Dec 28, 2013
how to get opengl working in code blocks? I have tried putting in the libraries and such in the correct folder. But I get an error saying that glut32.dll could not be found. I am running a 10.5 code blocks
View 1 Replies
View Related
Sep 12, 2014
#include <string>
#include<iostream>
#include<algorithm>
#include<conio.h>
//#include<stdlib.h>
using namespace std;
int check (const char *c,len) {
char ch='a';
if(len%2!=0)
[Code] ....
View 8 Replies
View Related
Aug 14, 2014
I have a script that checks and compares two lists from an offline dictionary. Dictionary.txt which has a lot of words in it. input.txt will compare to dictionary.txt and print out anything that matches in CMD.
However, instead of using an offline dictionary is there anyway to make a code check an online dictionary? If so, would this process be slow or fast?
View 8 Replies
View Related
Aug 8, 2013
I'm not sure what I'm missing. It is supposed to input and display player's name and score, calculate the average score, and display the players who scored below average.
It simply doesn't work. All I get is a black screen. Debug spits out an exit code of 1073741510 (0xc000013a).
Code:
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
const int arSize = 100;
int inputPlayerData (string playerName [], int playerScore [], int &numPlayers);
[Code] ....
View 6 Replies
View Related
Feb 24, 2015
I'm pretty new to C++ and I'm on Binary Trees in "Jumping into C++"! I've just created a DLL project on Code::Blocks, and I cannot get it to build and run: "You must select a host application to "run" a library..." is the message that I'm getting when I run the main code file. It's had no changes to it (except for a few extra, unnecessary line feeds), and it's the file which Code::Blocks generates on a DLL project.
View 13 Replies
View Related
Nov 20, 2014
I was trying to make boost's serialization use less bytes, and I stumbled upon this, which removes the big debugging symbols:
strip --strip-debug
or
strip -w -K '!*serialization*'
This seems like a working command on msys, but how to implement this into code blocks.
View 1 Replies
View Related
Jun 9, 2013
This has happened before, when I try to run a code it will say "blah.exe has stopped working" and I would have to change the code in some way to make it work.
View 1 Replies
View Related
Apr 30, 2013
I'm using Code Blocks but for some reason it doesn't process alt symbols. You know... alt symbols are like this: ☺♫↓☻♪♥↕. Code Blocks says that they're "invalid characters". Is there any attatchments or mods so Code Blocks can process them or will changing the settings?
View 1 Replies
View Related
Jan 30, 2014
I'm unable to use the function random(num); in Code::Blocks. It shows the error : error: 'random' was not declared in this scope while the same code works fine in Borland's Turbo C++. How do I rectify this?
View 6 Replies
View Related
May 15, 2013
I find myself in a position where I am repeating the same pattern of, write shared lib, compile, link shared lib, write app lib "sandbox" dependent on shared lib, write shared lib, compile, link, write...
At each level of dependency I have to carry over previously shared libs, search directories, etc. How to automate this process, so I spend less time linking after each layer?
View 1 Replies
View Related
May 14, 2014
I've been using code::blocks to work on text files through fstream. But i cannot make it append using my code.
Here's my code:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
fstream dataFile;
dataFile.open("demofile.txt", ios::out);
[Code] ....
View 2 Replies
View Related
Aug 27, 2013
In my c project in code blocks , I have added another source file (KillerMoves.c) and a header file under the same name (KillerMoves.h). I added the "include guard" to prevent double inclusion. But from some reason, the program suddenly crashes with no warning or specific error. Without the new files,the program runs without any problems. This is the source .c file:
Code:
#include "KillerMoves.h"
void initKillersTable(){
for(int i = 0; i < 15; i++){
killersTable[i] = -1;
[code]....
View 11 Replies
View Related
Jun 8, 2013
I'm using Code:Blocks 12.11 on windows 7, with the built-in MinGW compiler. When I try and compile a program that has an error in it (misnamed variable, missing include, extra semi-colon somewhere, anything) instead of saying something about what went wrong it just has this:
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
Which is not particularly useful for debugging.
View 11 Replies
View Related
Oct 4, 2014
I want to show my output in one line. But my output breaks to next line even before endl is encountered.code blocks horizontal scroll bar in console? is it c++ formatting issue or console issue?
View 3 Replies
View Related
May 20, 2013
I want to make a basic RPG text based games with multiple classes. but I wan to know how In one class I make a variable and in another and can call the variable.
for exmaple
class2:
int hi = 1;
class1:
class2 a;
hi = 2;
cout << hi;
2
View 1 Replies
View Related
Nov 26, 2013
I'm trying to compile my project, but is not working, the weird thing is if i put all the code in 1 file it compile, but not in a project, source code:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <windows.h>
[Code] ....
CodeBlocks Project file: Download BattleShip-ProyectoARREGLADO.rar from Sendspace
View 12 Replies
View Related
Apr 29, 2013
I downloaded glew 1.9.0 files and dragged the lib, include, and bin of the glew into the mingw folder within Code Blocks. I don't know if this is the right thing to do I don't understand how this stuff works. Anyway, I tried to compile my openGL 3.0 program that uses glew and I got this error: The procedure entry point _glewBindArray could not be located in the dynamic link library glew32.dll, How do I install glew properly?
View 1 Replies
View Related
Apr 13, 2014
I have created a game.It is working fine in codeblocks, but when I am trying to run it outside codeblocks, it opens and closes immediately. I have pasted all the necessary files and dlls in root folder and debug folder. Here is the code:-
#include <iostream>
#include <SDL/SDL_mixer.h>
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <sstream>
const int WINDOWS_Height = 480;
const int WINDOWS_Width = 640;
[Code] .....
View 2 Replies
View Related
Mar 6, 2015
I am not a C programmer (or a programmer at all). I am just a hobbyist who writes random code (i.e.: ignorant).C is not my area, and I my experience with it is quite LIMITED!Today, I found out that if I need to get "square root" in C I will be in trouble if I depend solely on the compiler..Is it possible to make the compiler to generate smarter code for this (quite trivial code):
Code:
void intprime_c(unsigned long* fprimes, unsigned long count)
{
unsigned long divc = 3;
unsigned long num = 2;
unsigned long sqr;
unsigned long pfound = 0;
}
[code]...
By "without ugly hacks" I mean using already existing code that came with GCC. Because the others did not need ugly hacks to perform better (it is all about being fair).To compute the "square root" in x86 one just need 3 instructions:
fild
fsqrt
fistp
But the compiler is generating a call to a "fsqrt" function and wasting a lot of time by doing this. If not, then why is it taking so long? Is it something wrong in my code (at least the output was verified to be the correct)?
Time taken to get the first 2500000 primes (x86_64):
Assembly = 72.400s (human written, unoptimized, coder level: newbie (i.e.: ignorant))
pascal = 75.200s (written by the same person)
C (fsqrt) = 83.600s (written by the same person)
C (sqrt) = 85.900s (written by the same person)
If it matters, I compiled the C code with this command: gcc -O2 -fno-omit-frame-pointer -fPIC -c ./prime.
View 7 Replies
View Related
Apr 14, 2013
This: "The compiler may not always be able to insert the code for a function inline (such as with recursive functions or functions for which you have obtained an address), but generally, it will work."
For a function inline why wont it work for a recursive function or a function for which you have obtained an address?
Why cant the compiler still insert the inline?
View 4 Replies
View Related
Feb 10, 2013
I created a .txt file that I called in.txt. It has the letters: a b c d e. I put it in the same folder as the c++ code below. I was hoping that I after I compile and run the code, the in.txt file would read: e d c b a. Unfortunately, it doesn't. Even when I give the ofstream file another name, it does not create another text file.
Code:
#include<iostream>
#include<fstream>
#include <limits>
[Code].....
View 7 Replies
View Related
May 17, 2012
Code:
#include <cstdlib>
#include <iostream>
#include <string>
#include <stdio.h>
#include <windows.h>
#include <conio.h>
#include <exception>
#include <process.h>
using namespace std;
int main(int argc, char *argv[])
[code]....
View 10 Replies
View Related
Dec 6, 2013
i have turbo c++ 3.0 installed . my program is compiled without error and is running. but when i choose option to display scores in the consol , it hangs . check my code. i have to run this on same compiler. i just want to display all the contenets of text file .
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
[Code].....
View 4 Replies
View Related
Apr 18, 2014
Working on an assignment and I've hit TWO stumbling blocks. I now have to take the first line from a .txt file and use that number to determine the size of rows to create in my program. I am using fscanf but the program hangs. How can I read in this number, store it and use it in a for loop?
The second issue is after reading this number I have to print each number in the .txt file under a different column. (Note that it skips a line after reading the row count.) The .txt file is set up as follows:
9 1 3 6 4 7 8 8 6 1
The output should look sort of like:
Number 1 3 6 4 7 8 8 6 1
Here's my attempt:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <math.h>
typedef struct{
int number;
[Code] .......
View 2 Replies
View Related
Nov 15, 2013
My project is on an online shop in which you can manage a shop(adding ,deleting ,clearing and modifying items) also you can switch to different shops(all shops are same)
Code:
#include<iostream>
#include<fstream>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
[Code] ....
The logical problem is serious because i am not able to find the error!!! There is some problem with display lines in void shop()-->if(mode=='s') and if(mode=='d'). I add only one item but in output screen i see two items(sometimes >2)
*note* to run the above display lines in the output screen....first register--->add atleast one item--->see your shop
View 12 Replies
View Related