[Solved] c++ breaks on class function

EDIT: Wait… I hadn’t realized that this function is a member of the CXFileEntity class. It doesn’t look like it’s a static method, either. So in order to call this function, you already need to have instantiated a CXFileEntity object! Therefore, it’s likely that you absolutely do not want to be either deleting or creating … Read more

[Solved] double value calculation [closed]

Ok, so you want to take 18.33 and just use the integer part of the number and multiply that by something else….like the number 5. Here’s 2 ways you can do it: var something = (int)result * 5; //equals 90 (int) var somethingElse = Math.Truncate(result) * 5; //equals 90.0 (double) 1 solved double value calculation … Read more

[Solved] Coordinate system transformation, 3d projection to 2d plane

The problem can be expressed as finding the 3-by-3 matrix M such that the coordinates of a point P can be converted between the old coordinate system (P_old, 3 rows) and the new coordinate system (P_new, 3 rows). This is an affine transformation: P_old = Center + M * P_new (1) The (matrix-vector) multiplication with … Read more

[Solved] C Check duplicate string entries

#include <stdio.h> #include <string.h> int main(void){ char str[]= “/proc/proc hello/foo 4000”; char path[256]; char pid[10]; char *p; p=strrchr(str, ‘ ‘); strcpy(pid, p+1); *p=’\0’; strcpy(path, str); printf(“%s\n”, path);// /proc/proc hello/foo printf(“%s\n”, pid);// 4000 return 0; } 2 solved C Check duplicate string entries

[Solved] C++ Convert part of the Array into int

Hard to be sure because your question isn’t very clear. But perhaps this is what you want uint16_t z = *reinterpret_cast<uint16_t*>(array); Another possiblity is uint16_t z = static_cast<uint8_t>(buf[0])*256 + static_cast<uint8_t>(buf[1]); and another is uint16_t z = static_cast<uint8_t>(buf[1])*256 + static_cast<uint8_t>(buf[0]); Try them all, they differ only in what endianness they use. You should look that up. … Read more

[Solved] Data type of addresses [closed]

An address is simply an integer numeric value that refers to a memory location. The concept of a “type” is a language imposition – at the machine level addresses and data are all simply numeric (hence the term digital computers). The width of an address in terms of the number of bits depends on the … Read more

[Solved] How can i make that the lines in richTextBox1 will start from the right to the left?

Refer to the documentation on SelectionAlignment property: http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.selectionalignment%28v=VS.100%29.aspx Use the above (in your scenario) like so: richTextBox1.SelectAll(); richTextBox1.SelectionAlignment = HorizontalAlignment.Right; solved How can i make that the lines in richTextBox1 will start from the right to the left?

[Solved] How to create makefile

Why not try something like this: CC=g++ CFLAGS=-c -Wall LDFLAGS= SOURCES= p4KyuCho.cpp Stack.cpp OBJECTS=$(SOURCES:.cpp=.o) EXECUTABLE=hello all: $(SOURCES) $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS) *TAB* $(CC) $(LDFLAGS) $(OBJECTS) -o $@ .cpp.o: *TAB* $(CC) $(CFLAGS) $< -o $@ From: http://mrbook.org/tutorials/make/ SPACING/TABBING IS VERY, I REPEAT, VERY IMPORTANT IN MAKEFILES. read up on that. solved How to create makefile

[Solved] data[tail_++ %maxsize] meaning and order

The value of the expression tail_++ is tail_. The fact that ++ increments the value of the variable tail_ is a separate issue. The value of the expression is tail_. Therefore the value of tail_++ % maxsize is the same as tail_ % maxsize. Just be aware that after this code executes, the value of … Read more

[Solved] why using sizeof in malloc?

sizeof doesn’t return the size of the memory block that was allocated (C does NOT have a standard way to get that information); it returns the size of the operand based on the operand’s type. Since your pointer is of type struct A*, the sizeof operand is of type struct A, so sizeof always returns … Read more

[Solved] C++ weird error strstr [closed]

Your GetTextureGroupName() function is of a std::string type. The std::strstr() function does not accept a std::string as a parameter. Use the string c_str() member function instead: if (std::strstr(pMaterial->GetTextureGroupName().c_str(), “World textures”)){ pMaterial->ColorModulate(0.5, 0.5, 0.5); } Rather than falling back to C style strings you should explore the std::string facilities as pointed out in the comments. The … Read more