Hi guys, i need some help with C functions, i'm looking for a way to do two things but i'm struggling a little, was wondering if someone here can point me in the right direction. :)
1st problem:
This is a trivial one i want to join some variables together to make a new one. i know in vb.net it would be somthing along the lines of:
so if value1 was "Hello" and value2 was "World" i then set a label.text to value3 it would read "HelloWorld", can i do this in C some how?Code:value3 = value1 & value2
2nd problem:
This the code for my test app:
what i'm looking to do is output a string from "AAAA" to "ZZZZ", i have it working for "1:1:1:1" to "26:26:26:26" but am i able to change these numbers in to letters by doing something like this:Code:#include <stdio.h>
#include <stdlib.h>
int main()
{
int node1 = 1;
int node2 = 1;
int node3 = 1;
int node4 = 1;
while (node4 <= 26){
if (node1 <= 26){
printf("%i:%i:%i:%i\n", node1, node2, node3, node4);
node1 = node1++;
}
else if (node2 < 26){
node1 = 1;
node2 = node2++;
}
else if (node3 < 26){
node1 = 1;
node2 = 1;
node3 = node3++;
}
else{
node1 = 1;
node2 = 1;
node3 = 1;
node4 = node4++;
}
}
return 0;
}
Sorry if these are stupid questions, still very new to C.Code:int letnum = 10;
char alphab = "ABCDEFGHIJLMNOPQRSTUVWXYZ";
/* then do somthing like the following */
char letter = left(alpha, letnum);
/* to set "letter" to "J" */
Okiura