There seems to be a couple problems. Specificaly with lines
all: calc
calc: Stack.o calc.o
g++ stack.o calc.o
which have tabs in the dependency headers. Also the label 'calc' doesnt...
Type: Posts; User: dharh
There seems to be a couple problems. Specificaly with lines
all: calc
calc: Stack.o calc.o
g++ stack.o calc.o
which have tabs in the dependency headers. Also the label 'calc' doesnt...
scanf doesn't catch the carriage return very well, so in your loop when it comes back around their is a carriage return in the buffer. This carriage return seem to remain in there and thus causes...
Borland 5.5 free command line compiler. I don't get errors on compile, I get run time error, the in program code error "stack underflow".
Just as you declared the FILE *fp; in main you can also declare variables in functions. Like:
someFunction( ) {
char myChar;
int myInt;
/* doing other function stuff */
}
Since the type FILE is defined in c lib:
struct temp {
char strg1[ N ],strg2[ N ];
int test[ N ];
float fraction;
};
You put the structure definition outside the main so that other functions can define a structure ( like defining a char or int ). The file pointer is just fine inside main.
Heres how I do it.
struct temp {
char strg1[ N ],strg2[ N ];
int test[ N ];
float fraction;
};
For some reason the change in pointer location made from a function does not carry back. When I run this and input something like 1 + 2, I get stack underflow.
#include <stdio.h> /*...
Candidate release is a build which is being tested for bugs. Sometimes they actually release this to the general public, but not the official release. They start doing this when enough features are...
No way inside the function?
That explains some of the problems ive had in the past.
I guess the final question I have is:
struct ipList **getList( void ) {
static struct ipList *list[ MAXLIST ];
int i;
Though im still not sure how:
malloc( MAXLIST * sizeof( struct ipList * ) );
differs from:
malloc( MAXLIST * sizeof( struct ipList ) );
exactly. I do understand what I was doing wrong with the...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXLIST 10
struct ipList {
int id;
char *name;
char *ip;
This is mostely a problem ive made for myself. I have:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXLIST 10
struct ipList {
Every now and then I throw code around, sorry if a decapitate a head or two.
void swap( int &x, int &y ) {
int temp;
temp = x;
x = y;
y = temp;
}
or
void swap(int *x, int *y) {
Here is an example of what I use to read stuff from stdin.
/* fgets _stdin function, gets like fgets using _stdin
*/
int gets_s(char *str, int size) {
/* variable to say if there has...
I think he might want to something where, if the buffer is empty do nothing. If the buffer has something in it, read it.
thanks, that worked
ok, im having a problem where im trying to read data in from a file and im getting extra data I don't want. Can't quite even figure out where this data is from sometimes.
example of file:
...
prototype/function would look something like this:
void function(int array2[], int size);
the call would look something like this:
#define ROWS 50
int array[ROWS];
The best way I think to go about projects like that are ultimately to build programs of your own design around the things your learning. I learn much better and faster when I have to apply concepts...
What error does the linker give? strlen works perfectly fine for me? Might have something to do with how you did your #includes before.
As for the pause thing, I use batch files to compile and...
#include "..\ownh.h"
#include "..\stdio.h"
int main (void)
{
/* Input of String-array *
char mystring [21] ;
printf ("fill in a string: ");
scanf ("%s",mystring);
What exactly did you do?