Hello all,
Last week I was a debugging a code and a weird situation came up: gdb passes through two different return clauses. I made a simple example that illustrates the situation:
#include <iostream>
using namespace std;
int test() {
string a = "asd";
string b = "asd";
while (true) {
if (a == b) {
...
I am confused. I can not use this on a float? must it be a interger ?? I try to define that as a point but I guess I can not convert float to float *
//global definition
float g_posX = 0.0f;
&g_posX -= 3.03f;
...
Introduction:
I am currently developing a document classifier software in C/C++ and I will be using Naive-Bayesian model for classification. But I wanted the users to use any algorithm that they want(or I want in the future), hence I went to separate the algorithm part in the architecture as a plugin that will be attached to the main ap...
Honestly, I couldnt think of a better title for this issue because I am having 2 problems and I don't know the cause.
The first problem I have is this
//global declaration
float g_posX = 0.0f;
.............
//if keydown happens
g_posX += 0.03f;
&m_mtxView._41 = g_posX;
I get this error
cannot convert from 'float' to 'float *'
...
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:...
Is it possible to convert an object file .o that was created from a .c source code to .exe?
And if it is possible is there a direct command using gcc?
...
How will various functions that take printf format string behave upon encountering the %c format given value of \0/NULL?
How should they behave? Is it safe? Is it defined? Is it compiler-specific?
e.g. sprintf() - will it crop the result string at the NULL? What length will it return?
Will printf() output the whole format string or ju...
I have a problem about Linked Lists. I already know how to create structures and linked list. But now I have to create arbitrary number of linked list which are also be kept in another structure. Which means :
struct list{int x, struct list *next; };
struct parent{int x, struct list *head, struct parent *next;}
And after lists are...
I have a need for an efficient sort that doesn't have a callback, but is as customizable as using qsort(). What I want is for it to work like an iterator, where it continuously calls into the sort API in a loop until it is done, doing the comparison in the loop rather than off in a callback function. This way the custom comparison is lo...
Hi,
I'm doing a course in Operating Systems and we're supposed to learn how to use pipes to transfer data between processes.
We were given this simple piece of code which demonstrates how to use pipes,but I'm having difficulty understanding it.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
main()
{
int pipefd [2],...
Hi,
C bothers me with its handling of strings. I have a pseudocode like this in my mind:
char *data[20];
char *tmp; int i,j;
for(i=0;i<20;i++) {
tmp = data[i];
for(j=1;j<20;j++)
{
if(strcmp(tmp,data[j]))
//then except the uniqueness, store them in elsewhere
}
}
But when i coded this the results were bad.(I han...
Hello there,
I have a C code created in Plato3. I want to create an exe file so I can share it with others.
Can someone please tell me how is this possible ?
I have tried sending the exe file that is created when normally compiled, but it crashes every time in runs on computers other than mine ...
Please help,
Thanks :)
[EDIT]
Progr...
Hello,
Is there any difference between logical SSE intrinsics for different types? For example if we take OR operation, there are three intrinsics: _mm_or_ps, _mm_or_pd and _mm_or_si128 all of which do the same thing: compute bitwise OR of their operands. My questions:
Is there any difference between using one or another intrinsic (wi...
All the Python-provided types have a check method (i.e., PyList_Check) that allows you to check if an arbitrary PyObject* is actually a specific type.
How can I implement this for my own types? I haven't found anything good online for this, though it seems like a pretty normal thing to want to do.
Also, maybe I'm just terrible at look...
I'm developing a general purpose library which uses Win32's HeapAlloc
MSDN doesn't mention alignment guarantees for Win32's HeapAlloc, but I really need to know what alignment it uses, so I can avoid excessive padding.
On my machine (vista, x86), all allocations are aligned at 8 bytes. Is this true for other platforms as well?
...
Greetings,
I am trying to figure out which C/C++ compiler to use. I found this list of C/C++ compilers at Wikipedia:
http://en.wikipedia.org/wiki/List_of_compilers#C.2FC.2B.2B_compilers
I am fairly certain that I want to go with an open source compiler. I feel that if it is open source then it will be a more complete compiler since ma...
In the Android open-source qemu code I ran across this line of code:
machine->max_cpus = machine->max_cpus ?: 1; /* Default to UP */
It this just a confusing way of saying:
if (machine->max_cpus) {
; //do nothing
} else {
machine->max_cpus = 1;
}
If so, wouldn't it be clearer as:
if (machine->max_cpus == 0) machine->max_cpus =...
My university is hosting a Programming Competition, and have decided to support Turbo C (the 16-bit DOS version) as a valid programming environment. I have just read that PC^2, the software that is going to be used to auto-judge the competition, does not support 16-bit programs.
So, is there any alternative to Turbo C that I can use. I ...
Hi, I was suggested when I have some further questions on my older ones, to create newer Question and refer to old one. So, this is the original question: What is the C runtime library?
OK, from your answers, I now get thet statically linked libraries are Microsoft implementation of C standard functions. Now:
If I get it right, the sch...
Are there examples of recursion using only heap area?
...