C/C++ :: Seg Fault / Narrowed Down To Two Functions?
Feb 28, 2014if you need it here is the header file:
#ifndef INTSET_H
#define INTSET_H
class Node {
int key;
Node *left;
Node *right;
Node *parent;
[code].....
if you need it here is the header file:
#ifndef INTSET_H
#define INTSET_H
class Node {
int key;
Node *left;
Node *right;
Node *parent;
[code].....
I wrote one application using STL API's [vector,map,make_pair,pair]. Application is working fine in Windows 2008 server.
Same application failed in Windows Server 2012 R2 and the failure is randomly occurred.[once in 10 iteration]
I suspect some of my PC update is the root cause for this random failure.
I would like to know which is latest STL version for Windows 2012 R2 server. Is there any latest patch/update released by Microsoft?
Does it good idea to use Boost lib for the same? Which is the Boost lib version for Windows Server 2012 R2.
There is no compilation issue on Server 2008/Server 2012 R2 server.
I'm a little confused by my programming assignment this week. I've been working at it Wednesday and I've made progress but I'm still confused as to how I'm supposed to do this. The class I made is called Stack, and it's derived from a template class called StackADT. We also utilize a class called unorderedLinkedList, which is derived from a class called linkedList.
We're supposed to implement all of the virtual functions from stackADT in the Stack class. The Stack data is stored in a an unorderedLinkedList, so what I'm confused by is how to implement a few of the Stack functions because there are no functions in unorderedLinkedList which we could call to manipulate the data.
As you can see from my attached code, I'm really confused by how I'm supposed to implement the pop() and top() functions, and I also think my initializeList() function is wrong. We don't have any similar functions in unorderedLinkedList to call, so I'm at a loss of how i'd access my unorderedLinkedList. My initial thought was to call the similar functions in the class that unorderedLinkedList was derived from, linkedList, but I'm unsure of this is what we're supposed to do, or if theres actually a way to access my unorderedLinkedList without having to use the functions from the base class.
NOTE: We're not allowed to modify stackADT, unorderedLinkedList, and linkedList.
Stack.h
#include "stackADT.h"
#include "unorderedLinkedList.h"
template<class Type>
class Stack: public stackADT<Type>{
template <class T>
struct nodeType
{
T info;
nodeType<T> *link;
[Code]...
At the moment im trying out with pointing to an array of functions. I got this working as following:
typedef void (* functionPtr) ();
functionPtr functions[2][2]={{do11,do12}, {do21,do22}};
void do11(){DEBUG_PRINTLN("11");}
void do12(){DEBUG_PRINTLN("12");}
void do21(){DEBUG_PRINTLN("21");}
void do22(){DEBUG_PRINTLN("22");}
void loop(){
A=0;
B=1;
functions[A][b]();
}
But now I'm trying to use this to point to a function inside a class so instead of do11, i want to be able to point to Basic.Do11. Somehow this doesnt work and I keep on getting this message:
error: argument of type 'void (Basic::)()' does not match 'void (*)()'
identify the reason why I am getting a seg fault run error? I hate to bother but I've been trying for several days now to fix the same function.
class adjacencyList {
public:
explicit adjacencyList(int size);
void buildGraph(Edge inEdge);
void print();
[code].....
I am trying to practice different concepts in C++ programming. Following is the program which compile successfully but gives seg fault at runtime.
#include <iostream>
#include <string.h>
using namespace std;
class A {
char *name;
int i,j;
const double k;
static float l;
int &m;
[Code] ....
I have a c source file:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <regex.h>
typedef struct
[Code] .....
But the problem is i get a seg fault at the read function.
I've received a segmentation fault in this part of code:
Code:
for (; str[i] != '