Running the code with Qt creator it seems limiting the bound in the outer loop:
allows the code to run with out any memory violation errors. This might be a clue to the problem ( not sure what the code does )..
Edit: Opps! when I change the outer loop bound to 22 the code seems to run without any memory access violations on Fedora 23 using g++ version: 5.3.1 20151207 . Not sure what the problem is on your end. I would find which loop indexes the program crashes for you and then trace the code from there using a debugger.
hello,
i have a problem with strlen. I have written this:
for(y=13,z=0; cInBuf!=' ';y++)
{
cBuf=cInBuf;
z++;
}
len = strlen(cBuf);
out=len/2;
fprintf(outfile,"F%i",out);
If strlen is e.g. 22, it write F22. I want to write F2F2.
How can i do this?... (5 Replies)
Hello,
Just a little problem with the ksh function : strlen
I want to use this function in this little ksh program :
while read line ; do
TOTO=$line
TOTONB=strlen($TOTO)
echo $TOTONB (3 Replies)
When run it, segment fault.
What is wrong?
#include <stdio.h>
#include <stdlib.h>
const int max =20;
//****************************************************
// Input Matrix
//****************************************************
void inMatrixAA(int *AA, int row, int col)... (9 Replies)
In a declaration, I have:
const char comment_begin = "<!--";
const char comment_end = "-->";
const int comment_begin_len = strlen(comment_begin);
const int comment_end_len = strlen(comment_end);
When I compile, I get the warnings:
emhttpc.c:64: warning: initializer element is not... (10 Replies)
Hi all
In the ltp-posix test,there is a case in open_posix_testsuite\conformance\interfaces\timer_gettime\speculative/6-1.c
I run the above code,it will has a segment fault, if I modify it to below,it works well
Anybody can tell me why? (1 Reply)
My OS (Debian) and gcc use the UTF-8 locale. This code says that the char size is 1 byte but the size of 'a' is really 4 bytes.
int main(void)
{
setlocale(LC_ALL, "en_US.UTF-8");
printf("Char size: %i\nSize of char 'a': %i\nSize of Euro sign '€': %i\nLength of Euro sign: %i\n",... (8 Replies)
Hi,
Whether the following piece of code is placed in the read-only memory of code (text) segment or data segment?
char *a = "Hello";
I am getting two different answers while searching in google :( that's why the confusion is (7 Replies)
I always get segment fault, why? can sb help me and modify it, I have spend on much time on
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <string.h>
#define MAX 10
pthread_t thread;
void *thread1()
{
int *a;
int i, n;
... (1 Reply)
Hi
I have struggling a week to fix a program , in the begining i got SIGBUS , but after many attempts still the program gets SIGSEGV segment fault , In bellow i post the seg fault log + source codes. would really appreciate if experts help me to fix this segment fault error. any advice is... (2 Replies)
I am trying to reverse complement DNA sequence (string) with a short c++ code using boost library. Code was compiled without any warning/error, but ran into Segmentation fault.
My guess is the function to return a vector, but not sure.
#include <iostream>
#include <fstream>
#include <string>... (14 Replies)
Discussion started by: yifangt
14 Replies
LEARN ABOUT REDHAT
glubegintrim
GLUBEGINTRIM(3G)GLUBEGINTRIM(3G)NAME
gluBeginTrim, gluEndTrim - delimit a NURBS trimming loop definition
C SPECIFICATION
void gluBeginTrim( GLUnurbs* nurb )
void gluEndTrim( GLUnurbs* nurb )
PARAMETERS
nurb Specifies the NURBS object (created with gluNewNurbsRenderer).
DESCRIPTION
Use gluBeginTrim to mark the beginning of a trimming loop, and gluEndTrim to mark the end of a trimming loop. A trimming loop is a set of
oriented curve segments (forming a closed curve) that define boundaries of a NURBS surface. You include these trimming loops in the defini-
tion of a NURBS surface, between calls to gluBeginSurface and gluEndSurface.
The definition for a NURBS surface can contain many trimming loops. For example, if you wrote a definition for a NURBS surface that resem-
bled a rectangle with a hole punched out, the definition would contain two trimming loops. One loop would define the outer edge of the rec-
tangle; the other would define the hole punched out of the rectangle. The definitions of each of these trimming loops would be bracketed by
a gluBeginTrim/gluEndTrim pair.
The definition of a single closed trimming loop can consist of multiple curve segments, each described as a piecewise linear curve (see
gluPwlCurve) or as a single NURBS curve (see gluNurbsCurve), or as a combination of both in any order. The only library calls that can
appear in a trimming loop definition (between the calls to gluBeginTrim and gluEndTrim) are gluPwlCurve and gluNurbsCurve.
The area of the NURBS surface that is displayed is the region in the domain to the left of the trimming curve as the curve parameter
increases. Thus, the retained region of the NURBS surface is inside a counterclockwise trimming loop and outside a clockwise trimming loop.
For the rectangle mentioned earlier, the trimming loop for the outer edge of the rectangle runs counterclockwise, while the trimming loop
for the punched-out hole runs clockwise.
If you use more than one curve to define a single trimming loop, the curve segments must form a closed loop (that is, the endpoint of each
curve must be the starting point of the next curve, and the endpoint of the final curve must be the starting point of the first curve). If
the endpoints of the curve are sufficiently close together but not exactly coincident, they will be coerced to match. If the endpoints are
not sufficiently close, an error results (see gluNurbsCallback).
If a trimming loop definition contains multiple curves, the direction of the curves must be consistent (that is, the inside must be to the
left of all of the curves). Nested trimming loops are legal as long as the curve orientations alternate correctly. If trimming curves are
self-intersecting, or intersect one another, an error results.
If no trimming information is given for a NURBS surface, the entire surface is drawn.
EXAMPLE
This code fragment defines a trimming loop that consists of one piecewise linear curve, and two NURBS curves:
gluBeginTrim(nobj);
gluPwlCurve(..., GLU_MAP1_TRIM_2);
gluNurbsCurve(..., GLU_MAP1_TRIM_2);
gluNurbsCurve(..., GLU_MAP1_TRIM_3); gluEndTrim(nobj);
SEE ALSO gluBeginSurface(3G), gluNewNurbsRenderer(3G), gluNurbsCallback(3G), gluNurbsCurve(3G), gluPwlCurve(3G)GLUBEGINTRIM(3G)