Search Results

Search found 6123 results on 245 pages for 'unsigned char'.

Page 149/245 | < Previous Page | 145 146 147 148 149 150 151 152 153 154 155 156  | Next Page >

  • C++ error message output format

    - by sub
    If I want to trigger an error in my interpreter I call this function: Error( ErrorType type, ErrorSeverity severity, const char* msg, int line ); However, with that I can only output Name error: Undefined variable in line 1 instead of Name error: Undefined variable 'someVariableName' in line 1 I'm working entirely with strings (except for the error messages as they all are constant at the moment), so sprintf won't work. What is the best way to create an efficient error function that can output a constant message combined with a string that describes which object, e.g.: a non-existing variable, triggered the error?

    Read the article

  • .trim() in javascript not working in IE

    - by Jin Yong
    I tired to apply .trim() in javascript for one of my code. it's working fine under mozilla, but error display once I tried in IE8, does anyone know what is going on here? anyway I can make it work in IE? code: var ID = document.getElementByID('rep_id').value.trim(); error display: Message: Object doesn't support this property or method Line: 604 Char: 2 Code: 0 URI: http://test.localhost/test.js

    Read the article

  • Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ' '.

    - by sajad
    i am trying to query from a temp table,and i keep getting the message Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ' '. can somebody tell me wats the problem..is it due to convert.. plz help The query is select compid,2, convert(datetime, '01/01/' + CONVERT(char(4),cal_yr) ,101) ,0,  Update_dt, th1, th2, th3_pc , Update_id, Update_dt,1 from #tmp_CTF

    Read the article

  • How do you open a file in C++?

    - by superjoe30
    I want to open a file for reading, the C++ way. I need to be able to do it for text files, which would involve some sort of read line function, and a way to do it for binary files, which would provide a way to read raw data into a char* buffer.

    Read the article

  • In elisp is there a difference between the regex [\\]documentclass and \\documentclass?

    - by mcheema
    I was playing around with the rx function for generating regular expressions from sexps in ELISP but couldn't figure out how to generate the regular expression "\\documentclass" for use in org-export-latex-classes: (rx "\\documentclass") (rx "\\" "documentclass") (rx (char "\\") "documentclass") Which when evaluated give respectively the following outputs: "\\\\documentclass" "\\\\documentclass" "[\\]documentclass" Is "\\documentclass" equivalent to "[\\]documentclass"?---I think it is, but am not sure. Can I generate the former using rx? Edit: Whilst the question was valid I realize my motivation was not; because org-export-latex-classes use strings not regular expressions.

    Read the article

  • Call C (exposed) function from COBOL program

    - by Sunscreen
    Hi, Some time ago, I had created a DLL to be used in another C program. Basically I exposed specific functions by using the following within my dll: void __declspec(dllexport) MyFunc(myFirstArg, mySecondArg); Then I added an external file (MyExposedDll.h) with all exposed functions and structures to the new C program and included it: include MyExposedDll.h Now how can I use this dll (or mainly a dll) to a Cobol function? I need to expose a function that has two char* arguments and returns a boolean. Thanks, Sun

    Read the article

  • Change the label of GtkButton

    - by paultop6
    I want to be able to change the label of a GtkButton after the widget has been shown char *ButtonStance == "Connect"; GtkWidget *EntryButton = gtk_button_new_with_label(ButtonStance); gtk_box_pack_start(GTK_BOX(ButtonVbox), EntryButton, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(TopVbox), ButtonVbox, TRUE, TRUE, 0); gtk_widget_show_all(TopVbox); ButtonStance == "Disconnect"; gtk_button_set_label(GTK_BUTTON(EntryButton), ButtonStance); gtk_main(); Does anyone know how to do this?

    Read the article

  • VB Script and filename with space

    - by Ram
    Hi I wrote a VBS file to open the "6 May" folder with following content path = "F:\Test\2010\May\6 May" Set Sh = CreateObject("WSCript.Shell") Sh.Run ""path"",3,True Set Sh = Nothing However on executing this I am getting following error Windows Script Host Script: F:\Sperry\2010\May_06 May\open.vbs Line: 4 Char: 10 Error: Expected end of statement Code: 800A0401 Source: Microsoft VBScript compilation error OK Can anyone help me in this?

    Read the article

  • Use the keyword class as a variable name in C++

    - by Leif Andersen
    I am having trouble writing C++ code that uses a header file designed for a C file. In particular, the header file used a variable name called class: int BPY_class_validate(const char *class_type, PyObject *class, PyObject *base_class, BPY_class_attr_check* class_attrs, PyObject **py_class_attrs); This works in C as class isn't taken as a keyword, but in C++, class is. So is there anyway I can #include this header file into a c++ file, or am I out of luck? Thank you.

    Read the article

  • Specify a base classes template parameters while instantiating a derived class?

    - by DaClown
    Hi, I have no idea if the title makes any sense but I can't find the right words to descibe my "problem" in one line. Anyway, here is my problem. There is an interface for a search: template <typename InputType, typename ResultType> class Search { public: virtual void search (InputType) = 0; virtual void getResult(ResultType&) = 0; }; and several derived classes like: template <typename InputType, typename ResultType> class XMLSearch : public Search<InputType, ResultType> { public: void search (InputType) { ... }; void getResult(ResultType&) { ... }; }; The derived classes shall be used in the source code later on. I would like to hold a simple pointer to a Search without specifying the template parameters, then assign a new XMLSearch and thereby define the template parameters of Search and XMLSearch Search *s = new XMLSearch<int, int>(); I found a way that works syntactically like what I'm trying to do, but it seems a bit odd to really use it: template <typename T> class Derived; class Base { public: template <typename T> bool GetValue(T &value) { Derived<T> *castedThis=dynamic_cast<Derived<T>* >(this); if(castedThis) return castedThis->GetValue(value); return false; } virtual void Dummy() {} }; template <typename T> class Derived : public Base { public: Derived<T>() { mValue=17; } bool GetValue(T &value) { value=mValue; return true; } T mValue; }; int main(int argc, char* argv[]) { Base *v=new Derived<int>; int i=0; if(!v->GetValue(i)) std::cout<<"Wrong type int."<<std::endl; float f=0.0; if(!v->GetValue(f)) std::cout<<"Wrong type float."<<std::endl; std::cout<<i<<std::endl<<f; char c; std::cin>>c; return 0; } Is there a better way to accomplish this?

    Read the article

  • How to convert from string to a number, and vice-versa in C++?

    - by Igal
    DEAR All I'm new to the C++, so maybe someone can say what the proper way to write a function that gets a string char (represents number) and converts it to the integer number. For example : input : Sixty five, output: 65. Maybe it should use by cin.getline() ? Well, vice-versa is little bit simlper... Thanks for advance. Igal

    Read the article

  • What does this error mean: `somefile.c:200: error: the frame size of 1032 bytes is larger than 1024

    - by Pierre LaFayette
    During a make, I'm seeing an error along the lines of: cc1: warnings being treated as errors somefile.c:200: error: the frame size of 1032 bytes is larger than 1024 bytes The line number points to the closing brace of a c function that has a signature like this: void trace(SomeEnum1 p1, SomeEnum2 p2, char* format, ...) { Anyone know what this type of error means in general?

    Read the article

  • read lenght of string from stdin

    - by teoz
    I want to take a string from stdin but I don't want a static array of fixed size i knew that scanf need something where save the stdin input, but i can't do something like this: char string[10] scanf("%s",string); becouse i need to knew before how long will be the string in order to allocate the right memory space can you help me to resolve this problem?

    Read the article

  • depth first search graph by using linked list

    - by programmerwannabe
    im using mac book and i cannot read the text file using this code. moreover, can you guys please add function(graph is connected?, and is this graph tree?) inputA.txt consist 1 2 1 6 1 5 2 3 2 6 3 4 3 6 4 5 4 6 5 6 #include <stdio.h> #include <memory.h> #include <stdlib.h> #define MAX 10 #define TRUE 1 #define FALSE 0 typedef struct Graph{ int vertex; struct Graph* link; } g_node; typedef struct graphType{ int x; int visited[MAX]; g_node* adjList_H[MAX]; } graphType; typedef struct stack{ int data; struct stack* link; } s_node; s_node* top; void push(int item){ s_node* n=(s_node*)malloc(sizeof(s_node)); n->data = item; n->link = top; top = n; } int pop(){ int item; s_node* n=top; if(top == NULL){ puts("\nstack is empty!\n"); return 0; } else { item = n-> data; top = n->link; free(n); return item; } } void createGraph(graphType* g){ int v; g->x = 1; for(v=1 ; v < MAX ; v++){ g -> visited[v] = FALSE; g -> adjList_H[v] = NULL; } } void insertVertex(graphType* g, int v){ if(((g->x)) > MAX){ puts("\n it has been overed the number of vertex\n"); return ; } g -> x++; } void insertEdge(graphType* g, int u, int v){ g_node* node; if(u >= g -> x || v >= g -> x){ puts("\n no vertex in the graph\n"); return ; } node = (g_node*)malloc(sizeof(g_node)); node -> vertex = v; node -> link = g -> adjList_H[u]; g-> adjList_H[u] = node; } void print_adjList(graphType* g){ int i; g_node *p; for(i=1 ; i<g -> x ; i++){ printf("\n\t\t vertex %d adjacency list ", i); p = g -> adjList_H[i]; while(p){ printf("-> %d", p-> vertex); p = p-> link; } } } void DFS_adjList(graphType* g, int v) { g_node* w; top = NULL; push(v); g->visited[v] = TRUE; printf(" %d", v); while(top != NULL){ w=g->adjList_H[v]; while(w){ if (!g->visited[w->vertex]){ push(w->vertex); g->visited[w->vertex] = TRUE; printf(" %d", w->vertex); v = w->vertex; w=g->adjList_H[v]; } else w= w->link; } v = pop(); } } int main (int argc, const char * argv[]) { FILE *fp; char mychar; char arr[][2]={0, }; int j, k; int i; graphType *G9; G9 = (graphType*)malloc(sizeof(graphType)); createGraph(G9); for(i=1; i<7 ; i++) insertVertex(G9, i); fp = fopen("inputD.txt", "r"); for(j = 0 ; j< 10 ; j++){ for(k = 0 ; k < 2 ; k++){ mychar = fgetc(fp); if(mychar = EOF){ j=10; break; } else if(mychar == ' ') continue; else if(mychar <= '9' || mychar >= '1'){ arr[j][k] = mychar; printf("%d%d", arr[i][k]); } } } insertEdge(G9, 1, 2); insertEdge(G9, 1, 6); insertEdge(G9, 1, 5); insertEdge(G9, 2, 3); insertEdge(G9, 2, 6); insertEdge(G9, 3, 4); insertEdge(G9, 3, 6); insertEdge(G9, 4, 5); insertEdge(G9, 4, 6); insertEdge(G9, 5, 6); insertEdge(G9, 6, 5); insertEdge(G9, 6, 4); insertEdge(G9, 5, 4); insertEdge(G9, 6, 3); insertEdge(G9, 4, 3); insertEdge(G9, 6, 2); insertEdge(G9, 3, 2); insertEdge(G9, 5, 1); insertEdge(G9, 6, 1); insertEdge(G9, 2, 1); printf("\n graph adjacency list "); print_adjList(G9); printf("\n \n//////////////////////////////////////////////\n\n depth fist search >> "); DFS_adjList(G9, 1); return 0; }

    Read the article

  • difference why.............

    - by gcc
    char x; for(i=0;i<256;i+=10) {x=i; if(x==i) printf("%d liii\n",i); else printf("%d sfffi\n",i); } 0 liii 10 liii 20 liii 30 liii 40 liii 50 liii 60 liii 70 liii 80 liii 90 liii 100 liii 110 liii 120 liii 130 sfffi 140 sfffi 150 sfffi 160 sfffi 170 sfffi 180 sfffi 190 sfffi 200 sfffi 210 sfffi 220 sfffi 230 sfffi 240 sfffi 250 sfffi

    Read the article

  • ld returned 1 exit status

    - by uzay95
    This is the code that i'm trying to run: #include <QApplication> #include <QPushButton> int main(int argc,char *argv[]) { QApplication app(argc,argv); return app.exec(); } And this is the error that i'm getting: :-1: error: collect2: ld returned 1 exit status

    Read the article

  • Definition of domains in mySQL?

    - by mal
    I'm working on a college exercise and have the following question: What is the domain of the "country" table? My understanding of domain is that it defines the possible values of an attribute. This means that the table "country" doesn't have a domain, but the various attributes in the table "country" have their own domains. For example the attribute "SurfaceArea" has the domain FLOAT(10,2) and the attribute "Name" has the domain CHAR(52). Is this correct?

    Read the article

  • two threads going to do func()

    - by nisnis84
    2 threads going to use the same func(). The 2 threads should be mutually exclusive. How do I get it to work properly? (output should be "abcdeabcde") char arr[] = "ABCDE"; int len = 5; void func(){ for(int i = 0; i <len;i++) printf("%c,arr[i]); }

    Read the article

  • Execution issue with PyModule_AddIntConstant function

    - by karnol
    I m learning python c api functions and keen to learn python 3.1 stable version. Found an unresolved issue recently and tried PyModule_AddIntConstant(PyObject *module, const char *name, long value) Runtime error occurred for this function call. Is there something wrong with the function in python 3.1?

    Read the article

  • Reading binary file with Octave

    - by Anthony Blake
    I'm trying to a binary file consisting of floats with Octave (on OS X), but I'm getting the following error: octave-3.2.3:2> load Input.dat R -binary error: load: failed to read matrix from file `Input.dat' The file was written like so: std::ofstream fout("Input.dat", std::ios::trunc | std::ios::binary); fout.write(reinterpret_cast<char*>(Buf), N*sizeof(double)); fout.close(); Any idea what could be going wrong here?

    Read the article

  • Limit Output in C

    - by Tech163
    In C, I would like to limit the string to the first 8 characters. For example, I have: char out = printf("%c", str); How can I make it so it only returns the first 8 characters?

    Read the article

  • Entity Framework 4 omits some associations during model generation

    - by kzen
    After creating an EF4 model from a SQL Server database I noticed that all the relationships of my Users table were not imported into the model as associations. All the other relationships were imported fine. My Users table has a PK userId which is a char(7) field and it is integrated into several other tables in the database as an FK but for some reason EF4 does not import these relationships as associations during the model generation process... Does anyone have any ideas why this would be happening?

    Read the article

  • C++: incorrect swapping of nodes in linked list

    - by Dragon
    I have 2 simple structures: struct Address { char city[255]; }; typedef Address* AddressPtr; struct Person { char fullName[255]; Address* address; Person* next; }; typedef Person* PersonPtr; The Person structure forms the Linked list where new elements are added to the beginning of the list. What I want to do is to sort them by fullName. At first I tried to swap links, but I lost the beginning of the list and as a result my list was sorted partially. Then I decided to sort list by swapping the values of nodes. But I get strange results. For a list with names: Test3, Test2, Test1, I get Test3, Test3, Test3. Here is my sorting code: void sortByName(PersonPtr& head) { TaskPtr currentNode, nextNode; for(currentNode = head; currentNode->next != NULL; currentNode = currentNode->next) { for(nextNode = currentNode->next; nextNode != NULL; nextNode = nextNode->next) { if(strcmp(currentNode->fullName, nextNode->fullName) > 0) { swapNodes(currentNode, nextNode); } } } } void swapNodes(PersonPtr& node1, PersonPtr& node2) { PersonPtr temp_node = node2; strcpy(node2->fullName, node1->fullName); strcpy(node1->fullName, temp_node->fullName); strcpy(node2->address->city, node1->address->city); strcpy(node1->address->city, temp_node->address->city); } After the sorting completion, nodes values are a little bit strange. UPDATED This is how I swapped links void swapNodes(PersonPtr& node1, PersonPtr& node2) { PersonPtr temp_person; AddressPtr temp_address; temp_person = node2; node2 = node1; node1 = temp_person; temp_address = node2->address; node2->address = node1->address; node1->address = temp_address; }

    Read the article

< Previous Page | 145 146 147 148 149 150 151 152 153 154 155 156  | Next Page >