C/C++ :: How To Increase Stack Size Ten Times

Apr 4, 2014

Actually whats the size of the stack and we can increase the size?

View 1 Replies


ADVERTISEMENT

Visual C++ :: Change Frame Window Size According To Increase In Font Size

Nov 27, 2012

Change the frame window size according to font size increases.

View 3 Replies View Related

C :: Pointer Size Increase - How Many Chars It Can Store

Dec 14, 2013

That code should make the size of the pointer (how many chars it can store) bigger but when i run it it show always 3 char positions while it should show N*M.

Code:
#include <stdio.h>#include <stdlib.h>
int main(void) {
int M, N, P, i;
scanf ("%d %d", &M, &N);
P = M * N;
char *c = malloc(P * sizeof(char));

[Code] ....

View 7 Replies View Related

C/C++ :: How To Increase Size Of Array During Program Execution

Apr 23, 2013

how we will increase the size of an arry during program execution. eg if the size of an array is 40 and during prog exexution we want to increase the size of an arry ,what is the procedure.

View 1 Replies View Related

Visual C++ :: How To Increase Font Size In Buttons

Jan 15, 2014

How to increase font size for a specific button? I tried to change the nHeight but it doesn't seems to change the font size.

Code:

CFont font;
font.CreateFont(
12, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_REGULAR, // nWeight

[Code] ....

View 3 Replies View Related

C/C++ :: Dynamic Allocation Of Array And Increase Its Size Every Time New Integer Inputted By User

Aug 29, 2014

I'm a little lost with this program. The idea is to dynamically allocate an array and increase its size every time a new integer is inputted by the user. I believe it is a memory leak but as we have just started learning this I'm not sure how to recognise it. Sometimes I can input as many integers as I want other times 2 or 3 before it crashes. When I can input enough values i exit the loop and send it to the sort function and mean calculator function, all works fine there except the last number inputted becomes this huge value not hexadecimal though... As such I'm at a loss as what to look at next, so here you go:

#include <iostream>
using namespace std;
void SelectSort(int [], int);
float MeanCalc(int [], int);
float MedianCalc(int* [], int);

[Code] .....

View 14 Replies View Related

C++ :: How To Set Stack Size With GCC MinGW

Jun 3, 2014

I'm following a course with coursera (algorithm 1) and my program for the assignment crashes inexorably (many are experimenting the same thing there, the assignment asks for a recursive program for solving a big graph of 500000 nodes). I'm using a version of g++ from MinGW with the editor Geany and windows7. The current setup is:

g++ -std=c++11 -Wall -c "%f"
g++ -std=c++11 -Wall -o "%e" "%f"

How can I set the stack 'unlimited'?

View 5 Replies View Related

Visual C++ :: What Is The Usual Maximum Size Of Stack Of A Win32 Program

Sep 24, 2014

I know that if the structure doesn't fit into the stack, it needs to be put onto the heap. But what is maximum size of a win32 stack in usual case?

View 4 Replies View Related

C++ :: Increase Char From A To B (or C To D)

Jun 11, 2014

#include <iostream>
using namespace std;
int main ()
{

[Code].....

the point of this code is to increase character by 1 (so from a to b in this case). The underlined line is the line that the system is rejecting at the moment (but there may be other issues).

View 8 Replies View Related

C++ :: Max Increase And Decrease In Arrays?

Sep 19, 2013

I have an array that is

int arr[4][2]={{1, 3}, {5, 9}, {0,1}, {2, 0}};

and I am trying to get this code worked to find the max drop which is [1][1]

- [2,0] = 9 and min drop which is [3][0] - [3][1]=2 but my code seems to be wrong.

#include <iostream>
#include <vector>
using namespace std;
int main() {
int arr[4][2]={{1, 3}, {5, 9}, {0,1}, {8, 3}};

[Code] ....

View 5 Replies View Related

C++ :: Increase Value Of Elements Of Array

Jan 18, 2013

I want to increase the value of some elements of an array according to a certain condition. For example the following code:

array <int, 100> myArray = {};
myArray.fill(0);
for(int i=1; i<5; i++)
*(myArray.being()+1) ++;

I was hoping myArray[1] = 5. But it actually did not work. But if I code:

int myVar = 0;
for(int i=1; i<5; i++)
myVar ++;

Result: myVar = 5.

View 2 Replies View Related

C++ :: Increase And Decrease Integer At The Same Time?

Dec 19, 2013

I had this question for a while - is it possbile (not intended, but if this "error" can occur) to actually increase AND decrease integer with ANY operation at the same time, so the result will be screwed integer? like this

int a = 0;
//some code
a++;
//meanwhile at the very same time, not the same code, so another thread or something
a -= 5

if it would go normally, the a would == -4, however is there any way that it will screw itself, and the "a" will be -5, or 1, or just will be somehow broken?

View 3 Replies View Related

C++ :: Increase Memory For Single Variable?

Nov 4, 2013

So, I've made programs like Prime number searchers and such. But the problem is if I use an int or long int variable for the program I am limited by the variable size. I can't search through numbers larger than their memory size. So my question is: Is there a way to allocate memory to a single variable, NOT AN ARRAY, so I can make a variable as many bytes as I want?

View 3 Replies View Related

C++ :: Increase Char Code Doesn't Work

Jun 11, 2014

Code:

#include <iostream>
using namespace std;
int main () {
char character = 'a';

[Code] .....

the point of this code is to increase character by 1 (so from a to b in this case).

The line highligted in red is the line that the system is rejecting at the moment (but there may be other issues). why it is invalid?

View 5 Replies View Related

C++ :: Glass Rod - Get Triangle Variable To Increase When Conditions Met

Jun 25, 2012

I'm working on a project, and can't seem to get the project to get the triangle variable to increase when the conditions are met. I need this number to be accurate so I can work out the probability.

Experiments that are either too expensive or too dangerous to perform are often simulated on a computer when the computer is able to provide a good representation of the experiment. Find out how to call the random-number generator (usually a function returning a floating point value in the range 0 to 1) for your C++ system. (Look up the functions rand and srand in the library cstdlib on the website cplusplus.com). Write a program that uses the random-number generator to simulate the dropping of glass rods that break into three pieces.

The purpose of the experiment is to estimate the probability that the lengths of the three pieces are such that they might form the sides of a triangle. For the purposes of this experiment, you may assume that the glass rod always breaks into three pieces. If you use the line segment 0 to 1 (on the real number line) as a mathematical model of the glass rod, a random-number generator (function) can be used to generate two numbers between 0 and 1 representing the coordinates of the breaks. The triangle inequality (the sum of the lengths of two sides of a triangle are always greater than the length of the third side) may be used to test the length of each piece against the lengths of the other two pieces.

To estimate the probability that the pieces of the rod form a triangle, you'll need to repeat the experiment many times and count the number of times a triangle can be formed from the pieces. The probability estimate is the number of successes divided by the total number of rods dropped. Your program should prompt the user for the number of rods to drop and allow the experiment to be repeated. Use a sentinel value of 21 to hale execution of the program.

Code:
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cfloat>
#include <iomanip>
#include <stdlib.h>
#include <time.h>
using namespace std;
float doBreak (float, float);
float doProbability (float, float);

[Code] ....

View 11 Replies View Related

C :: Program To Take Time And Date Typed By User And Increase It By 1 Minute

Mar 22, 2013

I'm having a problem with my homework. The task is to write a program that will take time and date typed by user, and increase it by 1 minute. I should write 3 functions - first calls second function that updates time and calls third function, if time is 00:00.Time update works, but date update does not.My whole written code:

Code:

#include<stdio.h>
struct DateAndTime {
struct date {
int day;
int month;
int year;

[code]....

I should check if inputs are numbers only, so I tried including isdigit function from ctype.h library, but that didn't work either, after I was trying it for a good hour or so, but I kinda rage quit that...

View 8 Replies View Related

C++ :: Add Score Between 0 And 1000 Inputted By User To Total And Increase Level

May 9, 2013

The program is supposed to have a method called Hitscore that adds a score between 0 and 1000 inputted by the user to the total score and increases level by one and print the score to the screen and which level they last completed after each entry . Have the user continue inputting scores to the program until the gamer has finished all 10 levels. After 10 levels, use a method you create called PassScore to have the program compare the score to avgscore (5000). If the score is less than avgscore, have the code respond "You are not angry at all. " if it is above avgscore, then have it respond "You seem quite angry, calm down. " and if it is exactly 5000, have it respond "Average, just average. "

//Angrybird.h
#ifndef ANGRYBIRD_H
#define ANGRYBIRD_H
using namespace std;
class Angrybird {
public:

float newscore;
float level;

[Code] .....

View 1 Replies View Related

Visual C++ :: Text Size In Screen Is Different From Size In Print Preview?

Feb 1, 2013

I must take an old MFC project in VC++ 6.0 and make changes.

The problem is text size in screen is different from size in print preview.

for example with this font

Code:
CFont f50;
f50.CreateFont(100,0,0,0,FW_BOLD,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE,"Frutiger LT Std 45 Light");

And this text

Code:
s=_T("Let's try to calculate the size of this text");

and with MM_LOMETRIC map mode

GetTextExtent() returns me:

On screen: (1595,99)
Ink printer + print preview: (1589,100)
PDFCreator + print preview: (1580,100)

comparing with screen size the height is bigger but lenght is smaller. I don't understand.

I can understand that different printers process the fonts in different way and then to have different lenghts. That's not the problem. The problem is I need to simulate in screen the same behaviour i will have on printer because these texts are being aligned in the document, and I don't want to see that the text si aligned different in text than in paper.

What can I do to render the text on screen with the same size I will have on the printer? Print preview is doing it. Should I change the font parameters? is something related with pixels per inch?

View 4 Replies View Related

C :: Why Size Of Struct Is Larger Than Sum Of All Size Of Its Members

Jul 11, 2013

I was wondering why, in C, the sizeof of a struct is larger than the the sum of all the sizeofs of it's members. It only seems to be by a few bytes, but as a bit of a perfectionist I fine this a bit annoying.

View 1 Replies View Related

C++ :: Increase Sizes Of Queue In A Vector Of Queues And Find Shortest Queue

Feb 20, 2013

I have a paradigm in a loop of queues of a vector,if a condition is true,increase sizes of the queue of that particular queue in the loop of queues, if condition is false, the queuesize is left as such in loop of queues. After this operation i need to search the queue sizes of all queues and enqueue in the shortest queue.

I want to do something like the code given below

#include <vector>
#include <queue>
int min_index = 0;
std::vector<std::queue<int> > q
std::size_t size = q.size();

[Code] ....

How to implement this logic?

will q[i].size=q[i].size+5 increase the queuesize by 5 for the ith queue?

View 12 Replies View Related

C++ :: Loop A Set Number Of Times

Oct 29, 2013

I have been trying to make a program that asks for username and password, and if it is wrong it will loop back to the top. But i only want it to loop a set number of times, how can i do this? This is my code so far

string username;
string password;
cout << "Enter username: ";
getline(cin, username, '

[Code] ....

View 4 Replies View Related

C++ :: Printing Too Many Times To The Screen

Mar 29, 2013

I've got most of the program to work but its printing to the screen 5 times and I only want it to print once.

Eg:
cos1512: 57.00%
mat1512: 86.50%
inf1520: 65.10%
cos1521: 78.40%
inf1505: 89.10%

but I get:

Semester Marks:
================
cos1512: 57.00%
mat1512: 57.00%
inf1520: 57.00%
cos1521: 57.00%
inf1505: 57.00%
cos1512: 86.50%
.....

My code:

#include <iostream>
using namespace std;
class Module {
public:
void setModules(string module1, string module2, string module3, string module4, string module5);
void setMarks(int aMark1, int aMark2);
int updateMarks();

[Code] .....

View 4 Replies View Related

C++ :: Why Copy Constructor Called 2 Times

Sep 15, 2013

I was wondering that why in the below code, the copy constructor is called 2 times.

Code:
class A {
private:
static int count;
int age;
public:
A()

[code].....

I think that when f(a) is called, since I am passing this as value, no copy constructor should be called. The copy constructor should called when the return object "x" is assigned to:

A b = x;

why copy constructor called 2 times?

View 9 Replies View Related

C :: Reading File Multiple Times?

Apr 5, 2014

so i have to read a text file with an unknown number of lines and allocate memory to for the number of items in the text file.currently i read the entire file(counting the number of lines). i allocate memory according to the number of lines read and then use fseek() with an offset of zero to allow for the second read .

View 5 Replies View Related

C++ :: Create A Loop That Repeat Itself Many Times A Second?

Aug 6, 2013

I create a loop that would repeat itself many times a second? Trying to do extremely basic graphics with a grid and system("cls") every time I run a command, but it still looks very jumpy. I realize system calls are evil. Any way to get rid of this too.

View 1 Replies View Related

C++ :: Draw The Same Sprite Multiple Times (SDL)?

Sep 7, 2014

I have a question about SDL and drawing sprites (SDL surfaces). My idea is that the user can create a wall of separate sprites by create one sprite each time in the current mouseX and mouseY position, when the user push down the e-key. The problem is that I have no idea how I could draw the same sprite multiple times without to delete the previous one.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved